tmux v1.8 current window name bug?

Latest response

I'm using tmux v1.8 and it sure seems to be acting odd. The session shows just fine. The ID is fine. The date is fine. But the Window name seems broken to me. Maybe something specific with v1.8? I took two screen shots, one with Ubuntu and one with RHEL 7.1. Same config file used on both. Here is my .tmux.conf

# use UTF8
set -g utf8
set-window-option -g utf8 on
bind r source-file ~/.tmux.conf \; display "Fully Loaded!"

# define window split keys
bind | split-window -h
bind - split-window -v

#set mouse features
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on

set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection

bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# setup Status Line
set -g window-status-format "#I:#W"
set -g window-status-current-format "#I:#W"

set -g automatic-rename on
set -g status-interval 1

# default status bar colors
set-option -g status-bg colour235
set-option -g status-fg colour11

# Default window title colors
set-window-option -g window-status-fg colour240
set-window-option -g window-status-attr dim

# Active window title colors
set-window-option -g window-status-current-fg colour10
set-window-option -g window-status-current-bg colour235
set-window-option -g window-status-current-attr dim

# clock
set-window-option -g status-right " %H:%M %d-%b-%y "
set-window-option -g status-right-fg colour166 

# message text
set-option -g message-bg colour235
set-option -g message-fg colour7

## END ##

And I have the two images added as well.

You'll see that in Ubuntu, also running v1.8, I have vim and top running and the status bar reflects this. On rhel I am running vim twice and it shows my user@host.

These settings:

# setup Status Line
set -g window-status-format "#I:#W"
set -g window-status-current-format "#I:#W"

specifically the "#I:#W" should show the Index : Window Name. Can't get it to actually show the Window name.

Attachments

Responses

I couldn't reproduce this with your config file. I'm using tmux-1.8-4.el7 from the RHEL Server channel.

I wonder if it's your terminal? I tried using both Terminator and Mate Terminal.

I'm using the Gnome desktop. Exact same tmux version...

Installed Packages
Name        : tmux
Arch        : x86_64
Version     : 1.8
Release     : 4.el7
Size        : 558 k
Repo        : installed
From repo   : rhel-7-workstation-rpms
Summary     : A terminal multiplexer
URL         : http://sourceforge.net/projects/tmux
License     : ISC and BSD
Description : tmux is a "terminal multiplexer."  It enables a number of
            : terminals (or windows) to be accessed and controlled from a single
            : terminal.  tmux is intended to be a simple, modern, BSD-licensed
            : alternative to programs such as GNU Screen.

Using the gnome terminal. Tried creating a new default profile. Tried a new user account. Same issue on both of my rhel machines. Very odd. I installed xterm and it does exactly the same thing. So sounds like where it goes to get the info for the variable is the problem.

I would also have tried a new user to rule anything out with ~/.bashrc or similar, good move there. Have you got anything funny in /etc/profile or similar?

You could verify the contents of the setup package (this owns /etc/profile and /etc/bashrc and /etc/inputrc) and the bash package like:

# rpm -V setup
# rpm -V bash

And you could check for additional strange files like:

# for file in /etc/profile.d/*; do echo -n "$file is owned by "; rpm -qf "$file"; done

I just did a quick strace -vfttT -o bash.txt bash to check which files bash opens when it starts, I think this covers all of them.

for rpm -V setup I got

..5....T. c /etc/printcap.  

If I understand the man page correctly, digest differs, mTime differs in the config file, /etc/printcap. So since I added a printer after install, that shouldn't be a problem, correct?

The other returned nothing.

The last part...

/etc/profile.d/256term.csh is owned by initscripts-9.49.24-1.el7.x86_64
/etc/profile.d/256term.sh is owned by initscripts-9.49.24-1.el7.x86_64
/etc/profile.d/abrt-console-notification.sh is owned by abrt-console-notification-2.1.11-22.el7_1.x86_64
/etc/profile.d/bash_completion.sh is owned by bash-completion-2.1-6.el7.noarch
/etc/profile.d/colorgrep.csh is owned by grep-2.20-1.el7.x86_64
/etc/profile.d/colorgrep.sh is owned by grep-2.20-1.el7.x86_64
/etc/profile.d/colorls.csh is owned by coreutils-8.22-11.el7.x86_64
/etc/profile.d/colorls.sh is owned by coreutils-8.22-11.el7.x86_64
/etc/profile.d/kde.csh is owned by kde-settings-19-23.5.el7.noarch
/etc/profile.d/kde.sh is owned by kde-settings-19-23.5.el7.noarch
/etc/profile.d/lang.csh is owned by initscripts-9.49.24-1.el7.x86_64
/etc/profile.d/lang.sh is owned by initscripts-9.49.24-1.el7.x86_64
/etc/profile.d/less.csh is owned by less-458-8.el7.x86_64
/etc/profile.d/less.sh is owned by less-458-8.el7.x86_64
/etc/profile.d/PackageKit.sh is owned by PackageKit-command-not-found-0.8.9-11.el7.x86_64
/etc/profile.d/perl-homedir.csh is owned by perl-homedir-1.008010-3.el7.noarch
/etc/profile.d/perl-homedir.sh is owned by perl-homedir-1.008010-3.el7.noarch
/etc/profile.d/qt.csh is owned by qt3-3.3.8b-51.el7.x86_64
/etc/profile.d/qt-graphicssystem.csh is owned by qt-settings-19-23.5.el7.noarch
/etc/profile.d/qt-graphicssystem.sh is owned by qt-settings-19-23.5.el7.noarch
/etc/profile.d/qt.sh is owned by qt3-3.3.8b-51.el7.x86_64
/etc/profile.d/vim.csh is owned by vim-enhanced-7.4.160-1.el7.x86_64
/etc/profile.d/vim.sh is owned by vim-enhanced-7.4.160-1.el7.x86_64
/etc/profile.d/vte.sh is owned by vte3-0.34.6-3.el7.x86_64
/etc/profile.d/which2.csh is owned by which-2.20-7.el7.x86_64
/etc/profile.d/which2.sh is owned by which-2.20-7.el7.x86_64

As for the strace, that's a big file. Attached.

Yeah printcap is just printers, bash doesn't read that, so no problem there.

You have a few different files to my working system:

$ ls -1 /etc/profile.d/
256term.csh
256term.sh
bash_completion.sh
colorgrep.csh
colorgrep.sh
colorls.csh
colorls.sh
gnome-ssh-askpass.csh
gnome-ssh-askpass.sh
guestfish.sh
lang.csh
lang.sh
less.csh
less.sh
mc.csh
mc.sh
qt-graphicssystem.csh
qt-graphicssystem.sh
vim.csh
vim.sh
vte.sh
which2.csh
which2.sh

so perhaps try moving out the ones which are different, like kde and perl-homedir. Put them in /root/ temporarily, then re-launch a bash window and see if tmux displays properly.

okay, nothing on that front. But I think something is weird here. If I su - into root I get a prompt in my terminal like this...

root@t450:~[root@t450 ~]#

It's like doubling the prompt. Yours doesn't look like that, right?

I have found the bloody bug!!

There is a bug in the /etc/bashrc

So here is the bad line of code.

PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}"              "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

It should be:

PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

The escape character is wrong. There is a funny looking character that was printing at the front of the prompt. I thought it was because maybe the ENV wasn't setup for root and I was too lazy to set it. After setting that it remained. So I started focusing on the prompt and the odd nature of it.

Started looking for odd characters in the PS1 prompt which lead me to improper escape characters. So went searching for improper escape characters and jack pot.

https://bugzilla.redhat.com/show_bug.cgi?id=969429

And what is rhel 7.x based on... Fedora 19.

So make the change, and ta da! My prompt is perfect, tmux is beautiful and I am happy!!

Thanks all for all the awesome help.

Aha, nice find! :)

You can see from /etc/bashrc that one of those PROMPT_COMMANDs is correct for $TERM=screen and one for $TERM=xterm*, and tmux defaults to reporting as a screen-256color.

I mess around with the TERM variable in my ~/.bashrc so perhaps that's why I didn't see this first.

I tried to reproduce with a plain bashrc and your tmux conf but it still worked fine for me. Strange.

That is strange. What happens if you execute this on your command line?

printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"

Do you get the odd character at the beginning of your prompt at least? That was what I saw when I switched to root.

I get a strange character once yes, the funny character doesn't print when rendered by the HTML here:

 $ printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"
kjbainbri@jbainbri-laptop:~[jbainbri@jbainbri-laptop ~]
 $

My PS1 usually has the space and newline in it.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.