pref: support `Home` and `End` input for cli (#313)

This commit is contained in:
Lykin 2024-07-26 11:09:13 +08:00
parent 29b51f836f
commit ee398d4d98
1 changed files with 9 additions and 0 deletions

View File

@ -253,6 +253,15 @@ const onTermKey = (e) => {
}
// block all ctrl key combinations input
return false
} else {
switch (e.key) {
case 'Home': // move to head of line
moveInputCursorTo(0)
return false
case 'End': // move to tail of line
moveInputCursorTo(Number.MAX_SAFE_INTEGER)
return false
}
}
}
return true