Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all. Debian Distribution: Squeeze Putty: 0.62 Problem: When arrow keys or tab pressed, the following character strings disply on screen instead of the cursor moving left or right, or ...
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3

    Question Putty, SSH, Arrow Keys Produce Character String

    Hi all.

    Debian Distribution: Squeeze
    Putty: 0.62

    Problem: When arrow keys or tab pressed, the following character strings disply on screen instead of the cursor moving left or right, or up or down. NB: This only happens when I am not logged in as root. When I do this, everything acts as expected.

    Expectation:
    Up: previous in command history
    Down: next in command history
    Left: move cursor left
    Right: move curos right
    Tab: tab completion

    What happens:
    Up: ^[[A
    Down: ^[[B
    Left: ^[[D
    Right: ^[[C
    Tab: <tab>

    Steps Taken, knowledge gained:
    Found an article on startup files of Readline (forum rules prevent me from posting a link to the article. I can PM anyone who is interested.)

    Tried: Adding following line to /etc/inputrc and ./usr/share/doc/bash/inputrc.arrows and restarting:

    Code:
    "^[[C" backward-char
    Tried: search -name inputrc* which yielded following files:

    ./etc/inputrc
    ./usr/share/doc/libreadline6/inputrc.arrows
    ./usr/share/doc/libereadline5/inputrc.arrows
    ./usr/share/doc/bash/inputrc.arrows
    ./usr/share/doc/readline-common/inputrc.arrows
    ./usr/share/readline/inputrc


    ./etc/inputrc
    Code:
    # /etc/inputrc - global inputrc for libreadline
      2 # See readline(3readline) and `info rluserman' for more information.
      3
      4 # Be 8 bit clean.
      5 set input-meta on
      6 set output-meta on
      7
      8 # To allow the use of 8bit-characters like the german umlauts, comment out
      9 # the line below. However this makes the meta key not work as a meta key,
     10 # which is annoying to those which don't need to type in 8-bit characters.
     11
     12 # set convert-meta off
     13
     14 # try to enable the application keypad when it is called.  Some systems
     15 # need this to enable the arrow keys.
     16 # set enable-keypad on
     17
     18 # see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
     19
     20 # do not bell on tab-completion
     21 # set bell-style none
     22 # set bell-style visible
     23
     24 # some defaults / modifications for the emacs mode
     25 $if mode=emacs
     26
     27 # allow the use of the Home/End keys
     28 "\e[1~": beginning-of-line
     29 "\e[4~": end-of-line
     30
     31 # allow the use of the Delete/Insert keys
     32 "\e[3~": delete-char
     33 "\e[2~": quoted-insert
     34
     35 # mappings for "page up" and "page down" to step to the beginning/end
     36 # of the history
     37 # "\e[5~": beginning-of-history
     38 # "\e[6~": end-of-history
     39
     40 # alternate mappings for "page up" and "page down" to search the history
     41 # "\e[5~": history-search-backward
     42 # "\e[6~": history-search-forward
     43
     44 # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
     45 "\e[1;5C": forward-word
    46 "\e[1;5D": backward-word
     47 "\e[5C": forward-word
     48 "\e[5D": backward-word
     49 "\e\e[C": forward-word
     50 "\e\e[D": backward-word
     51
     52 $if term=rxvt
     53 "\e[8~": end-of-line
     54 "\eOc": forward-word
     55 "\eOd": backward-word
     56 $endif
     57
     58 # for non RH/Debian xterm, can't hurt for RH/Debian xterm
     59 # "\eOH": beginning-of-line
     60 # "\eOF": end-of-line
     61
     62 # for freebsd console
     63 # "\e[H": beginning-of-line
     64 # "\e[F": end-of-line
     65
     66 $endif
    ./usr/share/doc/bash/inputrc.arrows
    Code:
      1 # This file controls the behaviour of line input editing for
      2 # programs that use the Gnu Readline library.
      3 #
      4 # Arrow keys in keypad mode
      5 #
      6 "\C-[OD"        backward-char
      7 "\C-[OC"        forward-char
      8 "\C-[OA"        previous-history
      9 "\C-[OB"        next-history
     10 #
     11 # Arrow keys in ANSI mode
     12 #
     13 "\C-[[D"        backward-char
     14 "\C-[[C"        forward-char
     15 "\C-[[A"        previous-history
     16 "\C-[[B"        next-history
     17 #
     18 # Arrow keys in 8 bit keypad mode
     19 #
     20 "\C-M-OD"       backward-char
     21 "\C-M-OC"       forward-char
     22 "\C-M-OA"       previous-history
     23 "\C-M-OB"       next-history
     24 #
     25 # Arrow keys in 8 bit ANSI mode
     26 #
     27 "\C-M-[D"       backward-char
     28 "\C-M-[C"       forward-char
     29 "\C-M-[A"       previous-history
     30 "\C-M-[B"       next-history
     31
     32 "\C-^[[D"         backward-char
    I diff'ed all the inputrc and inputrc.arrows - they're all identical to ./etc/inputrc and ./usr/share/doc/bash/inputrc.arrows So it's not a case of editting the wrong file.

    I'm out of ideas on how to proceed from here. I would really appreciate any help anyone can offer.

    Thanks.

  2. #2
    Linux User
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    260
    Why are you using PUTTY from a Unix/Linux box? Just use "ssh" and/or "scp" from within a terminal window.

  3. #3
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3
    My apologies. I wasn't clear: I'm using ssh to access a Debain box from a PC running Windows 7.

  4. #4
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3
    SOLVED.

    Found an article that gives instructions on how to change the default shell for a given user. I used the following:

    Code:
    chsh -s /bin/bash user-name
    Man chsh for any further details.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •