edkolev / tmuxline.vim

Simple tmux statusline generator with support for powerline symbols and statusline / airline / lightline integration
MIT License
1.6k stars 90 forks source link

Setting window title in tmuxline_preset #76

Open bearcatsandor opened 7 years ago

bearcatsandor commented 7 years ago

Simply, is there a way to place the current window title into section a? Since the tmuxline_preset takes variables as arguments and that's not a variable, how would one do it? With a script?

In other words when i do an 'emerge -avuND @world'' which sets my window title to 'emerge (1 of 3) media-video/parole-0.9.1", i want that to appear in tmuxline_preset.

If i figure this out on my own, i'll place the answer here for others.

Thanks.

slabua commented 6 years ago

I have a similar problem. I realised that on a remote session, the parameter #W is replaced by the current running program, whilst locally it shows the title of the terminal. Locally I've also edited .bashrc in order to succesfully change the title of the terminal (gnome-terminal in this case) whenever a command is running. Though, after starting a tmux session, the terminal title is set to tmux for the whole duration of the session, making it seemingly impossible for tmuxline to show the running program, and in tmuxline I see user@host:path. I'm not sure which is the expected behaviour, but I would like to show in tmuxline the running command as well.

Edit: I checked more in detail, but it seems like the issue is not related to whether I use tmux locally or remotely. On one machine it shows the current command being executed, on the other machine, instead, the standard user@host:path. I have the exact system running, with the same tmux version and same tmuxline config file.

screenshot from 2018-01-09 17-03-24

Edit2: Further investigation made me solve my issue by editing line 32 of /etc/bashrc from PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' to PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'