Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Change window title of TMUX (and Screen)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3366
Location: de

PostPosted: Thu Sep 26, 2024 1:34 pm    Post subject: [solved] Change window title of TMUX (and Screen) Reply with quote

Hi,

I'm currently trying to modify my bashrc.

To change the title of my xterm-Window:
Code:
printf "\033]0;asdf\007"


TMUX and Screen have different Escape sequences. Google (and Claude AI) told me:
Code:
printf "\033kasdf\033\\"


But neither in Tmux nor in Screen it seems to work. What am I doing wrong?


Last edited by musv on Sun Sep 29, 2024 11:31 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9846
Location: almost Mile High in the USA

PostPosted: Thu Sep 26, 2024 2:04 pm    Post subject: Reply with quote

speaking for gnu-screen here as I don't tmux much:
Apparently there are two "titles" for gnu-screen, one is the label (C-a A) and other is the xterm escape sequence. The xterm escape sequence will be saved and ported over to the actual terminal as you switch, but does not affect the gnu-screen title which you have to use C-a A.
Which specifically are you trying to change? What environment are you trying to use?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20521

PostPosted: Fri Sep 27, 2024 12:43 am    Post subject: Reply with quote

It probably depends on what you want to do. I'm guessing you use a single screen or tmux session and want it to update the GUI window's title?

For tmux, probably this:
man tmux:
set-titles [on | off]
        Attempt to set the client terminal title using the tsl and fsl terminfo(5) entries if they exist.  tmux automatically sets these to
        the \e]0;...\007 sequence if the terminal appears to be xterm(1).  This option is off by default.

set-titles-string string
        String used to set the client terminal title if set-titles is on.  Formats are expanded, see the “FORMATS” section.
If you're using multiple windows within tmux, a comma (that is C-b, unless you've remapped C-b). Then there is also a pane title.

The "NAMES AND TITLES" section of the tmux man page may help.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3366
Location: de

PostPosted: Sun Sep 29, 2024 11:32 am    Post subject: Reply with quote

Thanks. At least for Tmux it worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum