I just switched one of my systems from Gentoo to Ubuntu. There is one difference between the two setups that is driving me mad, and I cannot figure out how to fix it. When I use the 'up arrow' to go to a previous command, the cursor is moved to the start of the line. In Gentoo the cursor would remain at the end of the line. I have been using this behavior for over 10 years, adapting to the new behavior will be a major pain. How does one configure this?

This happens in any terminal: urxvt, xterm, and the console before X starts. It happens in bash and zsh, and happens regardless of if I am using 'screen'. It seems to be a global setting.

2 Answers 2


With respect to zsh, in debian, therefore in ubuntu too, it seems to be caused by the global zshrc settings (/etc/zsh/zshrc).

I've been looking for this for a while. Today I wrote to the zsh-users list and got the answer: http://article.gmane.org/gmane.comp.shells.zsh.user/12079

There's even a debian bug about it: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383737


Though I don't have a Gentoo installation available I am going to guess that what you have described is almost certainly related to your readline configuration.

A quick scan through the man page indicates this option which looks close to what you might want.

history-preserve-point (Off) If set to on, the history code attempts to place point at the same location on each history line retrieved with previous-history or next-history.

  • If it happens in zsh, as the questioner says, it isn't readline. zsh doesn't use readline. Of course, a similar configuration difference could exist for ZLE as well. In which case this is only half the answer.
    – JdeBP
    Feb 12, 2012 at 12:05
  • This does indeed work for bash, which is a start. And as JdeBP Predicted, this does not work for zsh
    – Exodist
    Feb 12, 2012 at 16:08

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.