mirror of
https://github.com/tw93/Mole.git
synced 2026-02-08 17:19:19 +00:00
feat(ui): add Ctrl+U support and optimize paginated menu performance
This commit is contained in:
@@ -170,6 +170,7 @@ read_key() {
|
||||
case "$key" in
|
||||
$'\n' | $'\r') echo "ENTER" ;;
|
||||
$'\x7f' | $'\x08') echo "DELETE" ;;
|
||||
$'\x15') echo "CLEAR_LINE" ;; # Ctrl+U (often mapped from Cmd+Delete in terminals)
|
||||
$'\x1b')
|
||||
if IFS= read -r -s -n 1 -t 1 rest 2> /dev/null; then
|
||||
if [[ "$rest" == "[" ]]; then
|
||||
@@ -230,6 +231,7 @@ read_key() {
|
||||
'l' | 'L') echo "RIGHT" ;;
|
||||
$'\x03') echo "QUIT" ;;
|
||||
$'\x7f' | $'\x08') echo "DELETE" ;;
|
||||
$'\x15') echo "CLEAR_LINE" ;; # Ctrl+U
|
||||
$'\x1b')
|
||||
if IFS= read -r -s -n 1 -t 1 rest 2> /dev/null; then
|
||||
if [[ "$rest" == "[" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user