Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using GNOME Terminal 2.7.3 and zsh 4.3.9 (x86_64-unknown-linux-gnu)

Home and End are not working. Nothing happens and nothing gets displayed when I press them. but they work when I press shift + Home (Scrolls to the beginning of shell output.) and also work in other GUI programs. I googled and tried the following. No change :(

  885  bindkey "\e[1~" beginning-of-line
  886  bindkey "\e[H" beginning-of-line
  887  bindkey "\e1~" beginning-of-line
  888  bindkey "\eH" beginning-of-line
  889  bindkey "\e[0H" beginning-of-line

PS: When I am in the last tab and press Ctrl + pagedown I get ;5~ printed on the screen. Does that give any clue?

share|improve this question
Do you have a .inputrc in your home directory? Does this happen with a freshly created user? Did this always happen, or did it start one day? –  bahamat Sep 8 '11 at 14:46
No I don't have .inputrc. I don't permission to create new user. This was always like that. I'am living with ctrl +a and ctrl+e. –  balki Sep 8 '11 at 14:56
I guess in that case I won't suggest ctrl+a & ctrl+e ;-) –  bahamat Sep 8 '11 at 14:59

3 Answers 3

Escape sequences sent by function and cursor keys consist of an escape character followed by printable characters. Press Ctrl+ then Home. This will insert the escape sequence literally. Then add a bindkey instruction to your ~?.zshrc.

The instruction is likely to be (note O, not 0):

bindkey '\e[OH' beginning-of-line
bindkey '\e[OF' end-of-line
share|improve this answer
nothing gets printed when I press Ctrl then Home. Nothing happens. Tried changing 0 to O as well. –  balki Sep 9 '11 at 14:07

I found I had to hit CTRL-v, let go, then the Home or End key to get the sequences ^[[H and ^[[F for Home and End respectively. Adding the following lines to the .zshrc file solved the problem for me:

bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
share|improve this answer

Add these lines to /etc/zshrc and then do a source /etc/zshrc (taken from here)

bindkey '\e[1~'   beginning-of-line  # Linux console
bindkey '\e[H'    beginning-of-line  # xterm
bindkey '\eOH'    beginning-of-line  # gnome-terminal
bindkey '\e[2~'   overwrite-mode     # Linux console, xterm, gnome-terminal
bindkey '\e[3~'   delete-char        # Linux console, xterm, gnome-terminal
bindkey '\e[4~'   end-of-line        # Linux console
bindkey '\e[F'    end-of-line        # xterm
bindkey '\eOF'    end-of-line        # gnome-terminal
share|improve this answer

Your Answer


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.