Mac iTerm hint
Here's a quick tip for using iTerm to connect to Linux servers.
To get proper arrow key support in programs like vi, along with some other benefits, set the terminal type to 'linux'. The easiest way to do this is to create a new profile and use that profile for bookmarks that represent Linux servers you connect to.
Go to Bookmarks->Manage Profiles. Create a new 'Terminal Profile' called Linux and make sure to specify the terminal type as 'linux'.
Now go to Bookmarks->Manage Bookmarks and edit the bookmark for your linux server. Change the terminal profile to the profile you created above (Linux).

Now you're arrow keys will work, and the 'Linux' terminal type supports colors just like xterm-color.
On some Linux systems, however, you may lose some of your default command-prompt colors. This is because some distros check for the terminal type before enabling special command-prompts. I have verified that this is the case on Ubuntu Hardy Server Edition.
Your ~/.bashrc may have a section like this:
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\0
33[01;34m\]\w\[\033[00m\]\$ '
;;
*)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
;;
esac You simply need to add the following bit of code to get your fancy prompt back so that the code block looks like this:
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\0
33[01;34m\]\w\[\033[00m\]\$ '
;;
linux)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\0
33[01;34m\]\w\[\033[00m\]\$ '
;;
*)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
;;
esac




Post new comment