Change tmux pane title to current folder name

Multi tool use
up vote
6
down vote
favorite
By default, tmux
sets the current pane title as the active command (ex:vim
), even if allow-rename
is off
.
I want to change it to current folder name (basename $PWD
).
Note that I do not want to dynamically change window name, since I sometimes use rename-window
to set a custom name. In this case, the custom window name must persist.
tmux window-title
add a comment |
up vote
6
down vote
favorite
By default, tmux
sets the current pane title as the active command (ex:vim
), even if allow-rename
is off
.
I want to change it to current folder name (basename $PWD
).
Note that I do not want to dynamically change window name, since I sometimes use rename-window
to set a custom name. In this case, the custom window name must persist.
tmux window-title
Please clarify - when/how often do you want to change the pane title to the current folder name? Only when you specifically request it (with a shortcut/key-binding/command)? Or automatically, every time youcd
?
– JigglyNaga
Jun 28 '16 at 11:25
Both. Every time Icd
in a new dir, unless I had changed manually before.
– paulodiovani
Jun 28 '16 at 21:00
I thought it was the window name you wanted to change manually? The window name and pane title can be set independently of each other, using different escape sequences - see the Names and Titles section of the manual.
– JigglyNaga
Jun 28 '16 at 21:10
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
By default, tmux
sets the current pane title as the active command (ex:vim
), even if allow-rename
is off
.
I want to change it to current folder name (basename $PWD
).
Note that I do not want to dynamically change window name, since I sometimes use rename-window
to set a custom name. In this case, the custom window name must persist.
tmux window-title
By default, tmux
sets the current pane title as the active command (ex:vim
), even if allow-rename
is off
.
I want to change it to current folder name (basename $PWD
).
Note that I do not want to dynamically change window name, since I sometimes use rename-window
to set a custom name. In this case, the custom window name must persist.
tmux window-title
tmux window-title
edited Jun 16 '16 at 22:48


Gilles
522k12610401571
522k12610401571
asked Jun 16 '16 at 17:05
paulodiovani
1416
1416
Please clarify - when/how often do you want to change the pane title to the current folder name? Only when you specifically request it (with a shortcut/key-binding/command)? Or automatically, every time youcd
?
– JigglyNaga
Jun 28 '16 at 11:25
Both. Every time Icd
in a new dir, unless I had changed manually before.
– paulodiovani
Jun 28 '16 at 21:00
I thought it was the window name you wanted to change manually? The window name and pane title can be set independently of each other, using different escape sequences - see the Names and Titles section of the manual.
– JigglyNaga
Jun 28 '16 at 21:10
add a comment |
Please clarify - when/how often do you want to change the pane title to the current folder name? Only when you specifically request it (with a shortcut/key-binding/command)? Or automatically, every time youcd
?
– JigglyNaga
Jun 28 '16 at 11:25
Both. Every time Icd
in a new dir, unless I had changed manually before.
– paulodiovani
Jun 28 '16 at 21:00
I thought it was the window name you wanted to change manually? The window name and pane title can be set independently of each other, using different escape sequences - see the Names and Titles section of the manual.
– JigglyNaga
Jun 28 '16 at 21:10
Please clarify - when/how often do you want to change the pane title to the current folder name? Only when you specifically request it (with a shortcut/key-binding/command)? Or automatically, every time you
cd
?– JigglyNaga
Jun 28 '16 at 11:25
Please clarify - when/how often do you want to change the pane title to the current folder name? Only when you specifically request it (with a shortcut/key-binding/command)? Or automatically, every time you
cd
?– JigglyNaga
Jun 28 '16 at 11:25
Both. Every time I
cd
in a new dir, unless I had changed manually before.– paulodiovani
Jun 28 '16 at 21:00
Both. Every time I
cd
in a new dir, unless I had changed manually before.– paulodiovani
Jun 28 '16 at 21:00
I thought it was the window name you wanted to change manually? The window name and pane title can be set independently of each other, using different escape sequences - see the Names and Titles section of the manual.
– JigglyNaga
Jun 28 '16 at 21:10
I thought it was the window name you wanted to change manually? The window name and pane title can be set independently of each other, using different escape sequences - see the Names and Titles section of the manual.
– JigglyNaga
Jun 28 '16 at 21:10
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I do this by setting the title using an echo command and having it executed in the PROMPT_COMMAND environment variable. This comes up as a common question in other environments. Here's really good information on it.
Set dynamic window title based on command input
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I do this by setting the title using an echo command and having it executed in the PROMPT_COMMAND environment variable. This comes up as a common question in other environments. Here's really good information on it.
Set dynamic window title based on command input
add a comment |
up vote
0
down vote
I do this by setting the title using an echo command and having it executed in the PROMPT_COMMAND environment variable. This comes up as a common question in other environments. Here's really good information on it.
Set dynamic window title based on command input
add a comment |
up vote
0
down vote
up vote
0
down vote
I do this by setting the title using an echo command and having it executed in the PROMPT_COMMAND environment variable. This comes up as a common question in other environments. Here's really good information on it.
Set dynamic window title based on command input
I do this by setting the title using an echo command and having it executed in the PROMPT_COMMAND environment variable. This comes up as a common question in other environments. Here's really good information on it.
Set dynamic window title based on command input
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Mar 19 '17 at 4:32
Joshua K
44846
44846
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f290199%2fchange-tmux-pane-title-to-current-folder-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
g9trqirtd,htr5MviqLvHjg1zwHIPh,WyVK2x
Please clarify - when/how often do you want to change the pane title to the current folder name? Only when you specifically request it (with a shortcut/key-binding/command)? Or automatically, every time you
cd
?– JigglyNaga
Jun 28 '16 at 11:25
Both. Every time I
cd
in a new dir, unless I had changed manually before.– paulodiovani
Jun 28 '16 at 21:00
I thought it was the window name you wanted to change manually? The window name and pane title can be set independently of each other, using different escape sequences - see the Names and Titles section of the manual.
– JigglyNaga
Jun 28 '16 at 21:10