1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +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

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;