posix shell: handle Home & End (Editing keys)

See https://github.com/mintty/mintty/wiki/Keycodes#editing-keys
This commit is contained in:
Beat Küng 2018-01-12 15:28:47 +01:00
parent dfe1b59949
commit 86e2f9c306
1 changed files with 9 additions and 0 deletions

View File

@ -593,10 +593,19 @@ int main(int argc, char **argv)
cursor_position = mystr.length();
break;
} else if (c == '1') { // Home (go to the beginning of the command, Editing key)
(void)getchar(); // swallow '~'
cursor_position = mystr.length();
break;
} else if (c == 'F') { // End (go to the end of the command)
cursor_position = 0;
break;
} else if (c == '4') { // End (go to the end of the command, Editing key)
(void)getchar(); // swallow '~'
cursor_position = 0;
break;
}
if (buf_ptr_read < 0) {