.screenrc

By | 2009/10/09

I presented earlier today at the Utah Open Source Conference and briefly demoed some of the use cases for screen. During the presentation I had a number of requests for my .screenrc file, so I thought I would attach it here. If you use screen for any reason you might find this useful.

Download

## general tweaks
vbell off
autodetach on
startup_message off
defscrollback 1000
attrcolor b ".I"
termcap xterm 'Co#256:AB=E[48;5;%dm:AF=E[38;5;%dm'
defbce "on"
#term screen-256color


## apps I want to auto-launch
#screen -t irssi irssi
#screen -t mutt mutt

## statusline, customized. (should be one-line)
hardstatus alwayslastline '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}[%{W}%n%f %t%?(%u)%?%{=b kR}]%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %D %m/%d %C%a ]%{W}'

6 thoughts on “.screenrc

  1. Brian_Arita

    I use this hard status because frequently I have a lot of windows open. I added comments for clarity
    # Output green [] with the hostname colored brown in the middle
    # %{= kG}[ %{y}%H %{g}]
    # Output a [ thats green
    # [
    # Leave a gap for the hostname
    # %15=
    # Mark that spot for truncation
    # %>
    # Print all the other windows prior to the current one up to 40% width
    # %-Lw%40>
    # Print out a red (
    # %{r}(
    # Print out White Bold Text Of the Window Number, a *, flags, title
    # %{W}%n*%f %t
    # Print out other users on that screen (if some exist)
    # %?(%u)%?
    # Print out a red ) and then switch back to green
    # %{r})%{g}
    # Print out all the other windows after the current one
    # %+Lw
    # Leave some room on the end for the date and time and mark that as the other truncation point
    # %-22<
    # Print the closing bracket, the opening bracket for the final section, a cyan marker, the date and time, and a green ]
    # ][%{c} %Y-%m-%d %c %{g}]
    hardstatus alwayslastline '%{= kG}[ %{y}%H %{g}][%15= %>%-Lw%40>%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{g}%+Lw%-22< ][%{c} %Y-%m-%d %c %{g}]'

    Another nice thing is to use this:
    bind e stuff 'echo -en "\\ekU@H\\e\\\\"|sed -e "s/H/`hostname`/" -e "s/U/`whoami`/"'

    So that when you ssh into a new computer you can have the title of the screen be User@hostname

    If you use vim to edit your screenrc file you can press Ctrl+v ctrl+m before the last ' on the echo command, then a return key will be added to that command.

  2. Brian_Arita

    I use this hard status because frequently I have a lot of windows open. I added comments for clarity
    # Output green [] with the hostname colored brown in the middle
    # %{= kG}[ %{y}%H %{g}]
    # Output a [ thats green
    # [
    # Leave a gap for the hostname
    # %15=
    # Mark that spot for truncation
    # %>
    # Print all the other windows prior to the current one up to 40% width
    # %-Lw%40>
    # Print out a red (
    # %{r}(
    # Print out White Bold Text Of the Window Number, a *, flags, title
    # %{W}%n*%f %t
    # Print out other users on that screen (if some exist)
    # %?(%u)%?
    # Print out a red ) and then switch back to green
    # %{r})%{g}
    # Print out all the other windows after the current one
    # %+Lw
    # Leave some room on the end for the date and time and mark that as the other truncation point
    # %-22<
    # Print the closing bracket, the opening bracket for the final section, a cyan marker, the date and time, and a green ]
    # ][%{c} %Y-%m-%d %c %{g}]
    hardstatus alwayslastline '%{= kG}[ %{y}%H %{g}][%15= %>%-Lw%40>%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{g}%+Lw%-22< ][%{c} %Y-%m-%d %c %{g}]'

    Another nice thing is to use this:
    bind e stuff 'echo -en "\\ekU@H\\e\\\\"|sed -e "s/H/`hostname`/" -e "s/U/`whoami`/"'

    So that when you ssh into a new computer you can have the title of the screen be User@hostname

    If you use vim to edit your screenrc file you can press Ctrl+v ctrl+m before the last ' on the echo command, then a return key will be added to that command.

  3. Brian_Arita

    I use this hard status because frequently I have a lot of windows open. I added comments for clarity
    # Output green [] with the hostname colored brown in the middle
    # %{= kG}[ %{y}%H %{g}]
    # Output a [ thats green
    # [
    # Leave a gap for the hostname
    # %15=
    # Mark that spot for truncation
    # %>
    # Print all the other windows prior to the current one up to 40% width
    # %-Lw%40>
    # Print out a red (
    # %{r}(
    # Print out White Bold Text Of the Window Number, a *, flags, title
    # %{W}%n*%f %t
    # Print out other users on that screen (if some exist)
    # %?(%u)%?
    # Print out a red ) and then switch back to green
    # %{r})%{g}
    # Print out all the other windows after the current one
    # %+Lw
    # Leave some room on the end for the date and time and mark that as the other truncation point
    # %-22<
    # Print the closing bracket, the opening bracket for the final section, a cyan marker, the date and time, and a green ]
    # ][%{c} %Y-%m-%d %c %{g}]
    hardstatus alwayslastline '%{= kG}[ %{y}%H %{g}][%15= %>%-Lw%40>%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{g}%+Lw%-22< ][%{c} %Y-%m-%d %c %{g}]'

    Another nice thing is to use this:
    bind e stuff 'echo -en "\\ekU@H\\e\\\\"|sed -e "s/H/`hostname`/" -e "s/U/`whoami`/"'

    So that when you ssh into a new computer you can have the title of the screen be User@hostname

    If you use vim to edit your screenrc file you can press Ctrl+v ctrl+m before the last ' on the echo command, then a return key will be added to that command.

  4. Brian_Arita

    I use this hard status because frequently I have a lot of windows open. I added comments for clarity
    # Output green [] with the hostname colored brown in the middle
    # %{= kG}[ %{y}%H %{g}]
    # Output a [ thats green
    # [
    # Leave a gap for the hostname
    # %15=
    # Mark that spot for truncation
    # %>
    # Print all the other windows prior to the current one up to 40% width
    # %-Lw%40>
    # Print out a red (
    # %{r}(
    # Print out White Bold Text Of the Window Number, a *, flags, title
    # %{W}%n*%f %t
    # Print out other users on that screen (if some exist)
    # %?(%u)%?
    # Print out a red ) and then switch back to green
    # %{r})%{g}
    # Print out all the other windows after the current one
    # %+Lw
    # Leave some room on the end for the date and time and mark that as the other truncation point
    # %-22<
    # Print the closing bracket, the opening bracket for the final section, a cyan marker, the date and time, and a green ]
    # ][%{c} %Y-%m-%d %c %{g}]
    hardstatus alwayslastline '%{= kG}[ %{y}%H %{g}][%15= %>%-Lw%40>%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{g}%+Lw%-22< ][%{c} %Y-%m-%d %c %{g}]'

    Another nice thing is to use this:
    bind e stuff 'echo -en "\\ekU@H\\e\\\\"|sed -e "s/H/`hostname`/" -e "s/U/`whoami`/"'

    So that when you ssh into a new computer you can have the title of the screen be User@hostname

    If you use vim to edit your screenrc file you can press Ctrl+v ctrl+m before the last ' on the echo command, then a return key will be added to that command.

  5. Brian_Arita

    I use this hard status because frequently I have a lot of windows open. I added comments for clarity
    # Output green [] with the hostname colored brown in the middle
    # %{= kG}[ %{y}%H %{g}]
    # Output a [ thats green
    # [
    # Leave a gap for the hostname
    # %15=
    # Mark that spot for truncation
    # %>
    # Print all the other windows prior to the current one up to 40% width
    # %-Lw%40>
    # Print out a red (
    # %{r}(
    # Print out White Bold Text Of the Window Number, a *, flags, title
    # %{W}%n*%f %t
    # Print out other users on that screen (if some exist)
    # %?(%u)%?
    # Print out a red ) and then switch back to green
    # %{r})%{g}
    # Print out all the other windows after the current one
    # %+Lw
    # Leave some room on the end for the date and time and mark that as the other truncation point
    # %-22<
    # Print the closing bracket, the opening bracket for the final section, a cyan marker, the date and time, and a green ]
    # ][%{c} %Y-%m-%d %c %{g}]
    hardstatus alwayslastline '%{= kG}[ %{y}%H %{g}][%15= %>%-Lw%40>%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{g}%+Lw%-22< ][%{c} %Y-%m-%d %c %{g}]'

    Another nice thing is to use this:
    bind e stuff 'echo -en "\\ekU@H\\e\\\\"|sed -e "s/H/`hostname`/" -e "s/U/`whoami`/"'

    So that when you ssh into a new computer you can have the title of the screen be User@hostname

    If you use vim to edit your screenrc file you can press Ctrl+v ctrl+m before the last ' on the echo command, then a return key will be added to that command.

Comments are closed.