Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

option dynamic_title didn't work #474

Closed
x70b1 opened this issue Apr 21, 2017 · 6 comments
Closed

option dynamic_title didn't work #474

x70b1 opened this issue Apr 21, 2017 · 6 comments

Comments

@x70b1
Copy link

x70b1 commented Apr 21, 2017

I tried to set dynamic title's. My expectation is if I open a dynamic command like top or htop the window title should change to top / htop. But this does not work at the moment. The title is still termite. I used xlsclients to look at it.

Another thing I saw: If I change to root with su and change back to my user the new title is user@host:/home/userdir. That is the default bash prompt style. But I set my own bash prompt style in .bashrc.

I used Arch with the termite-git package from AUR.

Any ideas?

@thestinger
Copy link
Owner

You still need to set it up: https://github.com/thestinger/termite#id1.

@j-degreef
Copy link

Set up what ?
The link you give leads to Keybindings > Insert mode :-/
Here the title changes with mc, ranger, cmus,... but not with top/htop, vim,...

@thestinger
Copy link
Owner

Yeah, so read that section. It's at the bottom.

@j-degreef
Copy link

I'm not sure I follow you. We're talking about having the app name in the title bar.
This code
if [[ $TERM == xterm-termite ]]; then . /etc/profile.d/vte.sh __vte_prompt_command fi
put the current directory in the title but not the app name.
BTW, I think it's up to the app to set the title with it's name.

@x70b1
Copy link
Author

x70b1 commented Apr 22, 2017

Yes, the second question is answered. A longer explanation of thestingers answer is here: https://github.com/gnunn1/tilix/wiki/VTE-Configuration-Issue

Thats the reason why wee need that code in our .bashrc to build correct prompts.

But the first question is not answered. Why set some commands a title and not every command?

@mb720
Copy link

mb720 commented Aug 26, 2018

As an alternative to __vte_prompt_command you can use PROMPT_COMMAND to set the window title dynamically.

In my case, I wanted the windows in Sway to show the current working directory.

I added this to .bashrc:

# After each command finishes, we set the terminal window title to the
# current working directory. If, for example, Vim sets the window title
# to the file's name and we exit Vim, the window title becomes the
# current directory again.
# There has to be a space between $(pwd) and \007 so the sequence is ended properly,
# otherwise the window title would not always be changed.
# These escape sequences are documented in man 4 console_codes.
# \033 is octal for ESC in ASCII, \007 is BEL
PROMPT_COMMAND="$PROMPT_COMMAND;echo -ne \"\033]0;\$(pwd) \007\""

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants