From 86e2f9c306efa11f975f227c418984a52823b863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 12 Jan 2018 15:28:47 +0100 Subject: [PATCH] posix shell: handle Home & End (Editing keys) See https://github.com/mintty/mintty/wiki/Keycodes#editing-keys --- src/platforms/posix/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/platforms/posix/main.cpp b/src/platforms/posix/main.cpp index 3ccf0b36e2..9fd4f108b1 100644 --- a/src/platforms/posix/main.cpp +++ b/src/platforms/posix/main.cpp @@ -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) {