2 Jan 2008 00:20
Ctrl+Left and Ctrl+Right revisited
Benno Schulenberg <bensberg <at> justemail.net>
2008-01-01 23:20:04 GMT
2008-01-01 23:20:04 GMT
Hi, A year ago I tried to get Ctrl+Left to go to the preceding word and Ctrl+Right to the next, but didn't succeed. Even with David's help it didn't work. This time around I put some print statements into the code, and saw that Ctrl+Left and Right never even reach get_escape_seq_kbinput(). With an 'fprintf(stderr, "BAD KEY: 0x%x ", input);' stuck in after the "Unknown command" message in nano.c, those two key combinations print 'BAD KEY: 0x203' and 'BAD KEY: 0x205' when running on an xterm or a Konsole. When simply running 'cat' those combinations produce the normal '^[[1;5D' and '^[[1;5C' sequences, but when 'nano' is running they apparently produce different codes. So with attached patch applied, finally Ctrl+Left and Ctrl+Right do what I want them to do (except that Ctrl+Left doesn't work on the status line.) This is of course not a proper addition: it simply replaces the existing two key combinations instead of adding two alternative ones, but this latter change is beyond me. Regards, Benno
_______________________________________________ Nano-devel mailing list(Continue reading)
RSS Feed