I have a fresh install of Ubuntu Server 11.10 that I am logging into SSH via PuTTy. When I am inside screen, I cannot use the up arrow to recall bash history (though this works outside of screen). I cannot seem to find the exact same problem on the Interwebs (though many similar ones). My .screenrc is below:

# Look and feel
caption always "%{= bb}%{+b w}Screen: %n | %h %=%t %c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

# Our warning of activity
activity "Activity in %t(%n)"

# Left Right meta key mods
#ALT-,. and ALT-<>
bindkey "^[<" eval number !echo $WINDOW-1|bc
bindkey "^[>" eval number !echo $WINDOW+1|bc
bindkey "^[," prev
bindkey "^[." next

#disable startup banner
startup_message off

#see http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html
termcap  xterm 'XT:AF=\E[3%dm:AB=\E[4%dm:AX'
terminfo xterm 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX'
termcapinfo xterm 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcap  xtermc 'XT:AF=\E[3%dm:AB=\E[4%dm:AX'
terminfo xtermc 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX'
termcapinfo xtermc 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

termcapinfo xterm ti@:te@

shell -$SHELL

UPDATE: The up arrow works properly in other apps such as vim and less. This problem occurs on the physical console as well as in PuTTy.

  • 2
    When in screen what is the value of the $TERM variable? – mdpc Nov 2 '11 at 23:11
  • "screen". I have tried changing it to "vt100" with no change in behavior. – Mike S Nov 3 '11 at 18:30
  • The default terminal type in Putty is "xterm" have you tried using that setting? – mdpc Nov 3 '11 at 18:47
  • Good point, however I do not think Putty is the issue for two reasons: 1.) Other Ubuntu (10.04LTS) servers' screen+bash work fine with the default PuTTy config, 2.) This issue crops up even when logged into the physical console. – Mike S Nov 3 '11 at 19:00
  • I have the same problem too on all my CentOS system. I want to know the answer too. :) – garconcn Nov 4 '11 at 4:29

I had a similar problem. Turns out the user account I created didn't have a default shell set.

  • /bin/bash is default in passwd and $SHELL – Mike S Nov 3 '11 at 19:42
  • I had the same problem with a new debian server, and this solution worked for me. – mhwombat Nov 26 '14 at 17:22

I use Ctrl-a Esc to enter copy/scrollback mode and then navigate using h j k l or arrow keys.

Read this for navigation options - http://web.mit.edu/gnu/doc/html/screen_11.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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