bindings: allow rebinding ^Z also on a Linux console (a VT)

Achieve this by translating KEY_SUSPEND back to ^Z.

(Strictly speaking, this is incorrect, as the terminfo entry
might specify some other keystroke for 'kspd', but... meh.)

This fixes https://savannah.gnu.org/bugs/?61573.

Bug existed since before version 2.2.0, since keys became rebindable.
master
Benno Schulenberg 2021-11-27 16:37:46 +01:00
parent 9ebee362a5
commit be87f110ce
2 changed files with 3 additions and 3 deletions

View File

@ -1497,9 +1497,8 @@ void shortcut_init(void)
#ifdef ENABLE_SPELLER
add_to_sclist(MMAIN, "F12", KEY_F(12), do_spell, 0);
#endif
#if defined(KEY_CANCEL) && defined(KEY_SUSPEND) && defined(KEY_SIC)
#if defined(KEY_CANCEL) && defined(KEY_SIC)
add_to_sclist((MMOST & ~MMAIN) | MYESNO, "", KEY_CANCEL, do_cancel, 0);
add_to_sclist(MMAIN|MEXECUTE, "", KEY_SUSPEND, do_suspend, 0);
add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile, 0);
#endif
#ifndef NANO_TINY

View File

@ -1244,7 +1244,8 @@ int parse_kbinput(WINDOW *win)
case KEY_SCANCEL:
return KEY_CANCEL;
case KEY_SSUSPEND:
return KEY_SUSPEND;
case KEY_SUSPEND:
return 0x1A; /* The ASCII code for Ctrl+Z. */
case KEY_BTAB:
return SHIFT_TAB;