1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Handle the escape sequence for the End key (#75)

Many terminals (xterm being one example) give the Home and End keys
the escape sequences '^[[H' and '^[[F'. The first sequence is
handled in both editing modes by moving the cursor to start of
line, but ksh ignored the second sequence.

src/cmd/ksh93/edit/emacs.c,
src/cmd/ksh93/edit/vi.c:
- Add case labels for '^[[F' so that in both editing modes the End
  key moves the cursor to the end of the line.
This commit is contained in:
Johnothan King 2020-07-15 15:38:44 -07:00 committed by GitHub
parent 1fbbeaa19d
commit 01145a48dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

4
NEWS
View file

@ -10,6 +10,10 @@ Any uppercase BUG_* names are modernish shell bug IDs.
that 'unalias -a' does not remove them. Shell functions can now use
these names, which improves compatibility with POSIX shell scripts.
- The End key escape sequence '^[[F' is now handled in the emacs and vi editing
modes. The End key moves the cursor to the end of the line (in contrast to
the Home key doing the opposite).
2020-07-14:
- Fixed a bug that caused 'set -b' to have no effect.

View file

@ -1105,6 +1105,7 @@ static int escape(register Emacs_t* ep,register genchar *out,int count)
case 'H':
ed_ungetchar(ep->ed,cntl('A'));
return(-1);
case 'F':
case 'Y':
ed_ungetchar(ep->ed,cntl('E'));
return(-1);

View file

@ -1669,6 +1669,7 @@ static int mvcursor(register Vi_t* vp,register int motion)
case 'H':
tcur_virt = 0;
break;
case 'F':
case 'Y':
tcur_virt = last_virt;
break;