Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using urxvt and running screen. My issues:

  • Underlining - some of the scripts I run have colored output. They are fine if I'm just running through urxvt, but when in screen, they are underlined and it makes it difficult to read
  • Scrollback - when switching between windows in screen and running commands, the scrollback for each window is messed up. Instead of only being the scrollback for the current window, it combines all the scrollback. So if I go from vim to another window and scroll up, I'll see my vim window.
  • Quiting Vim - When I quit vim in just urxvt, it hides the editor and I can see the prompts and commands I was running before calling vim. From inside screen, when I quit vim, I am given a prompt underneath the vim editor. I'd like for it to hide the editor like it does when not running urxvt.

Any ideas?

# terminfo and termcap for nice 256 color terminal                                                                                                                                                                  
# allow bold colors - necessary for some reason
attrcolor b ".I" 

# erase background with current bg color 
defbce "on" 

#terminfo rxvt-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
#terminfo screen 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'

# Skip the startup message
startup_message off

term xterm

screen  
title VIM

screen ssh bcooper@loki 
title Loki

screen ssh ...
title Logs

screen  
title Mac

select 1
select 0

hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'

bind ( eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"
bind ")" eval "exec sh -c 'pbpaste > /tmp/screen-exchange'" 

#Use the alternate screen - helps with quiting vim and not messing up current window
altscreen on

SETTINGS - Local Machine

declare -x COLORFGBG="15;0"
declare -x COLORTERM="rxvt"
declare -x COMMAND_MODE="unix2003"
declare -x DISPLAY="/tmp/launch-kxXxmI/org.x:0"
declare -x OLDPWD
declare -x declare -x PS1="[\\W]\$ "
declare -x SHELL="/bin/bash"
declare -x SHLVL="2"
declare -x SSH_AUTH_SOCK="/tmp/launch-QMhdZD/Listeners"
declare -x TERM="xterm"
declare -x TMPDIR="/var/folders/Ot/Ot3uMpWLF-aFeojPSVbhHU+++TI/-Tmp-/"
declare -x USER="briancooper"
declare -x WINDOWID="10485766"
declare -x X11_PREFS_DOMAIN="org.x.X11"
declare -x __CF_USER_TEXT_ENCODING="0x1F5:0:0"

Local Machine w/ Screen

declare -x Apple_PubSub_Socket_Render="/tmp/launch-cnvvgY/Render"
declare -x COLORFGBG="15;0"
declare -x COLORTERM="rxvt"
declare -x COMMAND_MODE="unix2003"
declare -x DISPLAY="/tmp/launch-kxXxmI/org.x:0"
declare -x OLDPWD
declare -x PS1="[\\W]\$ "
declare -x SHELL="/bin/bash"
declare -x SHLVL="3"
declare -x SSH_AUTH_SOCK="/tmp/launch-QMhdZD/Listeners"
declare -x STY="491.ttys000.brian-coopers-macbook-pro-2"
declare -x TERM="xterm"
declare -x TERMCAP="SC|xterm|VT 100/ANSI X3.64 virtual terminal:\\
        :DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E[Z:\\
        :cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:ct=\\E[3g:\\
        :do=^J:nd=\\E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\\
        :le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:\\
        :li#57:co#212:am:xn:xv:LP:sr=\\EM:al=\\E[L:AL=\\E[%dL:\\
        :cs=\\E[%i%d;%dr:dl=\\E[M:DL=\\E[%dM:dc=\\E[P:DC=\\E[%dP:\\
        :im=\\E[4h:ei=\\E[4l:mi:IC=\\E[%d@:ks=\\E[?1h\\E=:\\
        :ke=\\E[?1l\\E>:vi=\\E[?25l:ve=\\E[34h\\E[?25h:vs=\\E[34l:\\
        :ti=\\E[?1049h:te=\\E[?1049l:us=\\E[4m:ue=\\E[24m:so=\\E[3m:\\
        :se=\\E[23m:mb=\\E[5m:md=\\E[1m:mr=\\E[7m:me=\\E[m:ms:\\
        :Co#8:pa#64:AF=\\E[3%dm:AB=\\E[4%dm:op=\\E[39;49m:AX:\\
        :vb=\\Eg:G0:as=\\E(0:ae=\\E(B:\\
        :ac=\\140\\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\\
        :po=\\E[5i:pf=\\E[4i:Km=\\E[M:k0=\\E[10~:k1=\\EOP:k2=\\EOQ:\\
        :k3=\\EOR:k4=\\EOS:k5=\\E[15~:k6=\\E[17~:k7=\\E[18~:\\
        :k8=\\E[19~:k9=\\E[20~:k;=\\E[21~:F1=\\E[23~:F2=\\E[24~:\\
        :F3=\\E[1;2P:F4=\\E[1;2Q:F5=\\E[1;2R:F6=\\E[1;2S:\\
        :F7=\\E[15;2~:F8=\\E[17;2~:F9=\\E[18;2~:FA=\\E[19;2~:kb=^H:\\
        :K2=\\EOE:kB=\\E[Z:kF=\\E[1;2B:kR=\\E[1;2A:*4=\\E[3;2~:\\
        :*7=\\E[1;2F:#2=\\E[1;2H:#3=\\E[2;2~:#4=\\E[1;2D:%c=\\E[6;2~:\\
        :%e=\\E[5;2~:%i=\\E[1;2C:kh=\\E[1~:@1=\\E[1~:kH=\\E[4~:\\
        :@7=\\E[4~:kN=\\E[6~:kP=\\E[5~:kI=\\E[2~:kD=\\E[3~:ku=\\EOA:\\
        :kd=\\EOB:kr=\\EOC:kl=\\EOD:km:"
declare -x TMPDIR="/var/folders/Ot/Ot3uMpWLF-aFeojPSVbhHU+++TI/-Tmp-/"
declare -x WINDOW="0"
declare -x WINDOWID="8388614"
declare -x X11_PREFS_DOMAIN="org.x.X11"
declare -x __CF_USER_TEXT_ENCODING="0x1F5:0:0"

Remote Machine over SSH

declare -x CVS_RSH="ssh"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x INPUTRC="/etc/inputrc"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
declare -x LS_COLORS="no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
declare -x OLDPWD
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="10.1.0.110 50262 22"
declare -x SSH_CONNECTION="10.1.0.110 50262 10.1.2.20 22"
declare -x SSH_TTY="/dev/pts/9"
declare -x TERM="xterm"

Remote Machine over SSH w/ screen

declare -x CVS_RSH="ssh"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x INPUTRC="/etc/inputrc"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
declare -x LS_COLORS="no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
declare -x OLDPWD
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="10.1.0.110 50147 22"
declare -x SSH_CONNECTION="10.1.0.110 50147 10.1.2.20 22"
declare -x SSH_TTY="/dev/pts/4"
declare -x TERM="xterm"
share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

For the first and third points, try setting TERM while you're using screen to the same things it is when you're not (or if it's already the same, try setting it to "screen").

Edit:

To have vim exit so it shows the contents of the screen before you started it while running under screen, add altscreen to your ~/.screenrc file.

Edit 2:

To make underlined text show in color add this to your ~/.screenrc file:

attrcolor u "-u R"

The "R" stands for bright red. Lowercase would be normal. "B" is blue, etc.

Edit 3:

To stop the extraneous underlining, add this to your ~/.screenrc file:

attrcolor d -d

The first "d" stands for default. The "-d" means remove the "dim" attribute.

share|improve this answer
    
I tried changing my term to screen, xterm, or not setting it at all. All with the same result. I will post my current screenrc. Thanks for help. –  Brian Sep 16 '10 at 20:25
    
@Brian: Your shell startup file (e.g. ~/.bashrc) could be overwriting TERM. Do an echo TERM while running screen and while not and see if it is what you expect. –  Dennis Williamson Sep 16 '10 at 21:19
    
Doesn't appear to be. If I use xterm or screen in my screenrc, that is what it is set to once I'm running screen. Before I run screen, my TERM is set to xterm. –  Brian Sep 17 '10 at 13:26
1  
@Brian: Compare your phing defaults.properties to here. Also see: this. I was able to repro your problem. Using the following command in screen I got underlines. Without screen: no underlines. echo -e "\e[2;32mHello\e[m" Change the first two to a zero and the underline goes away. Edit classes/phing/listener/AnsiColorLogger.php and in the __construct() function change DIM to NORMAL and you should be OK. Or update to 2.4 or later. What ver. do you have? –  Dennis Williamson Sep 21 '10 at 19:56
1  
@Brian: See edit 3. I think we may have the underlines beaten! –  Dennis Williamson Sep 25 '10 at 4:06
show 11 more comments

Here's a partial answer.

  • Scrollback - To scroll back within a screen window, type Ctrl-A [. You can then use Vim-style cursor-movement and scrolling commands to move back through the scroll buffer. Just type <esc> to get out of that mode.
  • Quitting Vim - You already asked that question here. Did those answers not work?
share|improve this answer
    
Thanks for pointing me back to that question. I've been all over the place and forgot that I asked it. That did fix the issue with quiting vim. About the scrollback - I use Ctrl-A [ a lot. I guess I never tried to use it when I was scrolling with the mouse. I'll have to make sure I always scroll with the keyboard. Thanks. –  Brian Sep 16 '10 at 20:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.