Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On centos I can skip a word by hitting ctrl + arrow (left or right) in a terminal. When I ssh into a FreeBSD box and I try the same pattern I get:

$ tail -f 20120412.log;5D;5D;5D

(each try = ;5D)

Is there a way to fix this? I am using Ubuntu 12.04 + Terminator.

Thanks in advance.

share|improve this question

5 Answers 5

I installed ~/.inputrc of my own and ctrl+left stoped working for me on Ubuntu.

To get everything working I added the folloring to my .inputrc

# Include system wide settings which are ignored
# # by default if one has their own .inputrc
$include /etc/inputrc
share|improve this answer

Unless you have changed these from default, the shell that you're using on Ubuntu is bash. On FreeBSD, the default shell is csh. You can change your shell with the following command in both OSs:

chsh

Set your shell in FreeBSD to /usr/local/bin/bash. Bash is not part of FreeBSD, so if you haven't already, install it from ports:

cd /usr/ports/shells/bash
make install
make clean

Once last thing: don't change the shell for root. This is what the "toor" account is for: all the priveledges of root, but you can set the shell to whatever you want. The reason being that there aren't any system activities that run under toor, so you won't break anything or confuse anyone by changing that account's shell to something you are used to (or may be more functional as a login shell).

share|improve this answer

The shell you're running on the FreeBSD machine probably doesn't support that control sequence. Without knowing what shell you're running on either end, though, it's hard to say for sure.

share|improve this answer

Looks like you might have the wrong $TERM setting. echo $TERM to find out what your current setting is. might want to use xterm export TERM=xterm-256color

share|improve this answer
    
still no love =| –  jdorfman May 7 '12 at 23:09

If You use ZSH, then use this at /etc/zshrc file.

case "${TERM}" in
  cons25*|linux) # plain BSD/Linux console
    bindkey '\e[H'    beginning-of-line   # home 
    bindkey '\e[F'    end-of-line         # end  
    bindkey '\e[5~'   delete-char         # delete
    bindkey '[D'      emacs-backward-word # esc left
    bindkey '[C'      emacs-forward-word  # esc right
    ;;
  *rxvt*) # rxvt derivatives
    bindkey '\e[3~'   delete-char         # delete
    bindkey '\eOc'    forward-word        # ctrl right
    bindkey '\eOd'    backward-word       # ctrl left
    # workaround for screen + urxvt
    bindkey '\e[7~'   beginning-of-line   # home
    bindkey '\e[8~'   end-of-line         # end
    bindkey '^[[1~'   beginning-of-line   # home
    bindkey '^[[4~'   end-of-line         # end
    ;;
  *xterm*) # xterm derivatives
    bindkey '\e[H'    beginning-of-line   # home
    bindkey '\e[F'    end-of-line         # end
    bindkey '\e[3~'   delete-char         # delete
    bindkey '\e[1;5C' forward-word        # ctrl right
    bindkey '\e[1;5D' backward-word       # ctrl left
    # workaround for screen + xterm
    bindkey '\e[1~'   beginning-of-line   # home
    bindkey '\e[4~'   end-of-line         # end
    ;;
  screen)
    bindkey '^[[1~'   beginning-of-line   # home
    bindkey '^[[4~'   end-of-line         # end
    bindkey '\e[3~'   delete-char         # delete
    bindkey '\eOc'    forward-word        # ctrl right
    bindkey '\eOd'    backward-word       # ctrl left
    bindkey '^[[1;5C' forward-word        # ctrl right
    bindkey '^[[1;5D' backward-word       # ctrl left
    ;;
esac
share|improve this answer

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.