GNU Screen tab titles all just 'zsh'












0















OK, so I want to start by first explaining my setup. I have a windows desktop at home, and I am SSH'ing into an Amazon EC2 instance (via PuTTY) running Amazon Linux. I have zsh as my default shell, and oh-my-zsh installed as well. This "cloud developer desktop" model works well for me, but I am having one problem that I have poured more time into than I care to admit: GNU screen only shows 'zsh' as the title of every tab. This is despite using oh-my-zsh's screen plugin (which I think isn't doing anything). Anyone able to help me out? I'd love to have something more descriptive in the tab, perhaps just the last x characters of the current directory (or an open file name if one is open in vim).



Like many screen users, I've had what I'm asking for before, but on a new rig now and don't fully understand everything in my .screenrc:



# Many settings from https://gist.github.com/azitabh/7427682 and
# https://gist.github.com/joaopizani/2718397 and
# https://gist.github.com/ChrisWills/1337178

# Allow bold colors - necessary for some reason
attrcolor b ".I"

# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm "Co#256:AB=E[48;5;%dm:AF=E[38;5;%dm"

# Erase background with current bg color
defbce "on"

# Cache 30000 lines for scroll back
defscrollback 30000

# add tabs on bottom
caption always "%{= bb}%{+b w}%n %t %h %=%l %H %c"

# Very nice tabbed colored hardstatus line
#hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

#Remove vim buffer from scrollback history after quitting
altscreen on

# special xterm hardstatus: use the window title.
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]2;screen07'
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]1;screen07'

# Enable 256 color term
term xterm-256color

# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@

# tell screen that xterm can switch to dark background and has function keys.
termcapinfo xterm 'VR=E[?5h:VN=E[?5l'
termcapinfo xterm 'k1=E[11~:k2=E[12~:k3=E[13~:k4=E[14~'
termcapinfo xterm 'kh=E[1~:kI=E[2~:kD=E[3~:kH=E[4~:kP=E[H:kN=E[6~'

# window numbering starts at 1 not 0
bind c screen 1
bind 0 select 10
screen 1

#allow mouse scrolling in screen
termcapinfo xterm* ti@:te@

# Automatically detach on hangup.
autodetach on


I also tried adding this to my .zshrc, and it helps, but isn't quite what I want, as if you run ls, now your title is ls. Ie, not very informative. But maybe editing here is actually the right way to go:



# So screen tabs receive running process title
# preexec () {
# echo -ne "ek${1%% *}e\"
# }


Thanks in advance for your help!










share|improve this question

























  • Welcome to Stack Overflow! Please move your question to Super User (delete here, re-post there). It's off-topic here.

    – Martin Prikryl
    Jul 21 '18 at 6:32
















0















OK, so I want to start by first explaining my setup. I have a windows desktop at home, and I am SSH'ing into an Amazon EC2 instance (via PuTTY) running Amazon Linux. I have zsh as my default shell, and oh-my-zsh installed as well. This "cloud developer desktop" model works well for me, but I am having one problem that I have poured more time into than I care to admit: GNU screen only shows 'zsh' as the title of every tab. This is despite using oh-my-zsh's screen plugin (which I think isn't doing anything). Anyone able to help me out? I'd love to have something more descriptive in the tab, perhaps just the last x characters of the current directory (or an open file name if one is open in vim).



Like many screen users, I've had what I'm asking for before, but on a new rig now and don't fully understand everything in my .screenrc:



# Many settings from https://gist.github.com/azitabh/7427682 and
# https://gist.github.com/joaopizani/2718397 and
# https://gist.github.com/ChrisWills/1337178

# Allow bold colors - necessary for some reason
attrcolor b ".I"

# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm "Co#256:AB=E[48;5;%dm:AF=E[38;5;%dm"

# Erase background with current bg color
defbce "on"

# Cache 30000 lines for scroll back
defscrollback 30000

# add tabs on bottom
caption always "%{= bb}%{+b w}%n %t %h %=%l %H %c"

# Very nice tabbed colored hardstatus line
#hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

#Remove vim buffer from scrollback history after quitting
altscreen on

# special xterm hardstatus: use the window title.
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]2;screen07'
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]1;screen07'

# Enable 256 color term
term xterm-256color

# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@

# tell screen that xterm can switch to dark background and has function keys.
termcapinfo xterm 'VR=E[?5h:VN=E[?5l'
termcapinfo xterm 'k1=E[11~:k2=E[12~:k3=E[13~:k4=E[14~'
termcapinfo xterm 'kh=E[1~:kI=E[2~:kD=E[3~:kH=E[4~:kP=E[H:kN=E[6~'

# window numbering starts at 1 not 0
bind c screen 1
bind 0 select 10
screen 1

#allow mouse scrolling in screen
termcapinfo xterm* ti@:te@

# Automatically detach on hangup.
autodetach on


I also tried adding this to my .zshrc, and it helps, but isn't quite what I want, as if you run ls, now your title is ls. Ie, not very informative. But maybe editing here is actually the right way to go:



# So screen tabs receive running process title
# preexec () {
# echo -ne "ek${1%% *}e\"
# }


Thanks in advance for your help!










share|improve this question

























  • Welcome to Stack Overflow! Please move your question to Super User (delete here, re-post there). It's off-topic here.

    – Martin Prikryl
    Jul 21 '18 at 6:32














0












0








0








OK, so I want to start by first explaining my setup. I have a windows desktop at home, and I am SSH'ing into an Amazon EC2 instance (via PuTTY) running Amazon Linux. I have zsh as my default shell, and oh-my-zsh installed as well. This "cloud developer desktop" model works well for me, but I am having one problem that I have poured more time into than I care to admit: GNU screen only shows 'zsh' as the title of every tab. This is despite using oh-my-zsh's screen plugin (which I think isn't doing anything). Anyone able to help me out? I'd love to have something more descriptive in the tab, perhaps just the last x characters of the current directory (or an open file name if one is open in vim).



Like many screen users, I've had what I'm asking for before, but on a new rig now and don't fully understand everything in my .screenrc:



# Many settings from https://gist.github.com/azitabh/7427682 and
# https://gist.github.com/joaopizani/2718397 and
# https://gist.github.com/ChrisWills/1337178

# Allow bold colors - necessary for some reason
attrcolor b ".I"

# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm "Co#256:AB=E[48;5;%dm:AF=E[38;5;%dm"

# Erase background with current bg color
defbce "on"

# Cache 30000 lines for scroll back
defscrollback 30000

# add tabs on bottom
caption always "%{= bb}%{+b w}%n %t %h %=%l %H %c"

# Very nice tabbed colored hardstatus line
#hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

#Remove vim buffer from scrollback history after quitting
altscreen on

# special xterm hardstatus: use the window title.
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]2;screen07'
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]1;screen07'

# Enable 256 color term
term xterm-256color

# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@

# tell screen that xterm can switch to dark background and has function keys.
termcapinfo xterm 'VR=E[?5h:VN=E[?5l'
termcapinfo xterm 'k1=E[11~:k2=E[12~:k3=E[13~:k4=E[14~'
termcapinfo xterm 'kh=E[1~:kI=E[2~:kD=E[3~:kH=E[4~:kP=E[H:kN=E[6~'

# window numbering starts at 1 not 0
bind c screen 1
bind 0 select 10
screen 1

#allow mouse scrolling in screen
termcapinfo xterm* ti@:te@

# Automatically detach on hangup.
autodetach on


I also tried adding this to my .zshrc, and it helps, but isn't quite what I want, as if you run ls, now your title is ls. Ie, not very informative. But maybe editing here is actually the right way to go:



# So screen tabs receive running process title
# preexec () {
# echo -ne "ek${1%% *}e\"
# }


Thanks in advance for your help!










share|improve this question
















OK, so I want to start by first explaining my setup. I have a windows desktop at home, and I am SSH'ing into an Amazon EC2 instance (via PuTTY) running Amazon Linux. I have zsh as my default shell, and oh-my-zsh installed as well. This "cloud developer desktop" model works well for me, but I am having one problem that I have poured more time into than I care to admit: GNU screen only shows 'zsh' as the title of every tab. This is despite using oh-my-zsh's screen plugin (which I think isn't doing anything). Anyone able to help me out? I'd love to have something more descriptive in the tab, perhaps just the last x characters of the current directory (or an open file name if one is open in vim).



Like many screen users, I've had what I'm asking for before, but on a new rig now and don't fully understand everything in my .screenrc:



# Many settings from https://gist.github.com/azitabh/7427682 and
# https://gist.github.com/joaopizani/2718397 and
# https://gist.github.com/ChrisWills/1337178

# Allow bold colors - necessary for some reason
attrcolor b ".I"

# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm "Co#256:AB=E[48;5;%dm:AF=E[38;5;%dm"

# Erase background with current bg color
defbce "on"

# Cache 30000 lines for scroll back
defscrollback 30000

# add tabs on bottom
caption always "%{= bb}%{+b w}%n %t %h %=%l %H %c"

# Very nice tabbed colored hardstatus line
#hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

#Remove vim buffer from scrollback history after quitting
altscreen on

# special xterm hardstatus: use the window title.
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]2;screen07'
#termcapinfo xterm 'hs:ts=E]2;:fs=07:ds=E]1;screen07'

# Enable 256 color term
term xterm-256color

# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@

# tell screen that xterm can switch to dark background and has function keys.
termcapinfo xterm 'VR=E[?5h:VN=E[?5l'
termcapinfo xterm 'k1=E[11~:k2=E[12~:k3=E[13~:k4=E[14~'
termcapinfo xterm 'kh=E[1~:kI=E[2~:kD=E[3~:kH=E[4~:kP=E[H:kN=E[6~'

# window numbering starts at 1 not 0
bind c screen 1
bind 0 select 10
screen 1

#allow mouse scrolling in screen
termcapinfo xterm* ti@:te@

# Automatically detach on hangup.
autodetach on


I also tried adding this to my .zshrc, and it helps, but isn't quite what I want, as if you run ls, now your title is ls. Ie, not very informative. But maybe editing here is actually the right way to go:



# So screen tabs receive running process title
# preexec () {
# echo -ne "ek${1%% *}e\"
# }


Thanks in advance for your help!







amazon-ec2 putty gnu-screen oh-my-zsh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 19 '18 at 12:02









Vadim Kotov

4,50863347




4,50863347










asked Jul 18 '18 at 22:27









StrakerStraker

11




11













  • Welcome to Stack Overflow! Please move your question to Super User (delete here, re-post there). It's off-topic here.

    – Martin Prikryl
    Jul 21 '18 at 6:32



















  • Welcome to Stack Overflow! Please move your question to Super User (delete here, re-post there). It's off-topic here.

    – Martin Prikryl
    Jul 21 '18 at 6:32

















Welcome to Stack Overflow! Please move your question to Super User (delete here, re-post there). It's off-topic here.

– Martin Prikryl
Jul 21 '18 at 6:32





Welcome to Stack Overflow! Please move your question to Super User (delete here, re-post there). It's off-topic here.

– Martin Prikryl
Jul 21 '18 at 6:32












1 Answer
1






active

oldest

votes


















0














Answering my own question a bit here:



Replacing the line in the preexec () function above with this helps:



echo -ne "ek$(pwd)e\"


Would still be best to only grab the characters from the x-to-last '/' to the end though, replacing the initial string with '...'






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fstackoverflow.com%2fquestions%2f51411838%2fgnu-screen-tab-titles-all-just-zsh%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









    0














    Answering my own question a bit here:



    Replacing the line in the preexec () function above with this helps:



    echo -ne "ek$(pwd)e\"


    Would still be best to only grab the characters from the x-to-last '/' to the end though, replacing the initial string with '...'






    share|improve this answer






























      0














      Answering my own question a bit here:



      Replacing the line in the preexec () function above with this helps:



      echo -ne "ek$(pwd)e\"


      Would still be best to only grab the characters from the x-to-last '/' to the end though, replacing the initial string with '...'






      share|improve this answer




























        0












        0








        0







        Answering my own question a bit here:



        Replacing the line in the preexec () function above with this helps:



        echo -ne "ek$(pwd)e\"


        Would still be best to only grab the characters from the x-to-last '/' to the end though, replacing the initial string with '...'






        share|improve this answer















        Answering my own question a bit here:



        Replacing the line in the preexec () function above with this helps:



        echo -ne "ek$(pwd)e\"


        Would still be best to only grab the characters from the x-to-last '/' to the end though, replacing the initial string with '...'







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 26 '18 at 6:33









        LoneWanderer

        641820




        641820










        answered Nov 25 '18 at 21:35









        StrakerStraker

        11




        11






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51411838%2fgnu-screen-tab-titles-all-just-zsh%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

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks