~vcs-imports/nano/master

« back to all changes in this revision

Viewing changes to src/winio.c

  • Committer: Benno Schulenberg
  • Date: 2023-08-27 13:01:37 UTC
  • Revision ID: git-v1:f0f1c94afa378cc7e6a8e10f24dc35ee5c31016e
input: intercept a spurious keycode and say what the actual problem is

Xfce Terminal sets TERM to xterm-256color even though it does not have
all the capabilities that an xterm has, leading it to misinterpret some
escape sequence and produce a spurious 0x24C key code.

Intercept this mistaken key code and tell the user what is wrong.

This mitigates https://savannah.gnu.org/bugs/?64578.
Reported-by: Lawrence R. Steeger

Show diffs side-by-side

added added

removed removed

Lines of Context:
1320
1320
                case KEY_BTAB:
1321
1321
                        return SHIFT_TAB;
1322
1322
 
 
1323
                case 0x24C:
 
1324
                        statusline(ALERT, _("Wrong TERM for this terminal"));
 
1325
                        place_the_cursor();
 
1326
                        return ERR;
 
1327
 
1323
1328
                case KEY_SBEG:
1324
1329
                case KEY_BEG:
1325
1330
                case KEY_B2:    /* Center (5) on keypad with NumLock off. */