1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-08 01:34:21 +00:00

🎨 Better analysis experience

This commit is contained in:
Tw93
2025-10-05 16:40:43 +08:00
parent d8909053e8
commit f7a88558d5
3 changed files with 81 additions and 61 deletions

View File

@@ -114,6 +114,7 @@ read_key() {
'd'|'D') echo "DELETE" ;;
'r'|'R') echo "RETRY" ;;
'?') echo "HELP" ;;
$'\x03') echo "QUIT" ;; # Ctrl+C
$'\x7f'|$'\x08') echo "DELETE" ;; # Delete key (labeled "delete" on Mac, actually backspace)
$'\x1b')
# ESC sequence - could be arrow key, delete key, or ESC alone

View File

@@ -48,10 +48,18 @@ paginated_multi_select() {
stty echo icanon 2>/dev/null || true
leave_alt_screen
}
trap cleanup EXIT INT TERM
# Setup terminal
stty -echo -icanon 2>/dev/null || true
# Interrupt handler
handle_interrupt() {
cleanup
exit 130 # Standard exit code for Ctrl+C
}
trap cleanup EXIT
trap handle_interrupt INT TERM
# Setup terminal - preserve interrupt character
stty -echo -icanon intr ^C 2>/dev/null || true
enter_alt_screen
hide_cursor