Red Hat Bugzilla – Bug 121922
Home and End keys don't work in nano anymore
Last modified: 2007-11-30 17:10:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Description of problem:
When editing a text file, the "Home" and "End" keys don't work anymore
to go to the beginning or end of a line.
The "Home" key just prints "H" and the "End" key just prints "F"
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.nano -w test.txt
2.type a few characters
3.press "Home" or "End"
Actual Results: The "Home" key just prints "H" and the "End" key just
Expected Results: Home moves the cursor to the beginning of the line
and End moves to the end of the line
This worked fine in Fedora Core 1.
This bug is a real PITA. :)
Acutally, this looks like a gnome-terminal bug as nano works fine in
text-mode and in xterm.
Home and End are also broken in emacs -nw, in BOTH gnome-terminal and
OK. It seems gnome-terminal now send Alt-O-H for home and Alt-O-F for
end. Nano doesn't know what to do with those.
Here is a clean patch for nano to fix this. Here is also a patch for
the spec file.
Can this be included before Fedora Core 2 comes out so nano will work
Created attachment 99887 [details]
Patch for nano to fix home and end
Created attachment 99888 [details]
Patch for spec file
This is bizarre; konsole, gnome-terminal and xterm all generate
_different_ bytes on pressing 'Home'. All set TERM to 'xterm', yet I
see (on fc2):
gnome-terminal: 1b 4f 48
konsole: 1b 5b 48
xterm: 1b 5b 31 7e
That's odd... I get Alt-O-H and Alt-O-F in konsole, same as
gnome-terminal. The patch I made works for konsole too in my case.
What is the status on this bug?
These escape sequences are already in nano CVS...
on a related note, nano also has wirdness with the +-*/ keys on the
keypad if TERM=xterm (they print kjmo, respectively).. Setting to
TERM=linux fixes the issue (although doesn't fix the home/end issue in
fc2, it did in fc1 - it also makes vi freak out in fc2). pressing
control-V in bash, and then any of the +-*/ keys doesn't produce any
escape sequences, so I can't see what's going on with nano.
ncurses changed here and broke everything, I don't know if the nano
thing is worth fixing too: see bug 121922.
Duh, bug 122815.
Bug 122815 shure looks like it will resolve the nano bug.
I guess if ncurses is fixed, this bug can be closed.
What's the status? We are moving to FC4 and nano still has this issue.
This WORKSFORME now, as a result of the fix for Bug 122815 and has for
a long time.
*** This bug has been marked as a duplicate of 122815 ***
*** Bug 132032 has been marked as a duplicate of this bug. ***