Change tmux pane title to current folder name











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.










share|improve this question
























  • 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















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.










share|improve this question
























  • 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













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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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


















  • 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
















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










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






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    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

























    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






    share|improve this answer



























      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






      share|improve this answer

























        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






        share|improve this answer














        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







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:36









        Community

        1




        1










        answered Mar 19 '17 at 4:32









        Joshua K

        44846




        44846






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            サソリ

            広島県道265号伴広島線

            Accessing regular linux commands in Huawei's Dopra Linux