Opened 11 years ago

Closed 10 years ago

#2853 closed bug (fixed)

[Terminal] midnight commander Fx keys are shifted

Reported by: diver Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

mc running via ssh have shifted Fx keys. For example to exit mc you have to press F11, or to create a folder - F8

Attachments (1)

VTKeyTbl.c.diff (378 bytes ) - added by oco 10 years ago.
Patch to generate right escape sequences for function keys under an xterm terminal

Download all attachments as: .zip

Change History (7)

comment:1 by kaliber, 11 years ago

And it's starting from F6 (prints 16~).

comment:2 by Adek336, 11 years ago

I think it's not related to ssh: if you run vim locally, in insert mode, press F7 and a <F6> gets written.

comment:3 by kaliber, 11 years ago

The problem is that key codes (in src/apps/terminal/VTKeyTbl.c) are adjusted for beterm. Unfortunately the default TERM variable is set to xterm, so key codes should be as follow:

char *function_key_char_table [] =
{
"\033OP",
"\033OQ",
"\033OR",
"\033OS",
"\033[15~",
"\033[17~",
"\033[18~",
"\033[19~",
"\033[20~",
"\033[21~",
"\033[22~",
"\033[24~",
};

by oco, 10 years ago

Attachment: VTKeyTbl.c.diff added

Patch to generate right escape sequences for function keys under an xterm terminal

comment:4 by oco, 10 years ago

Here is a patch to fix function keys handling (same as above with one more fix for F11 and F12). Implemented according to http://rtfm.etla.org/xterm/ctlseq.html. It also fix function keys handling in the textmode freepascal IDE.

comment:5 by axeld, 10 years ago

Owner: changed from jackburton to axeld
Status: newassigned

comment:6 by axeld, 10 years ago

Resolution: fixed
Status: assignedclosed

Thanks! Applied in hrev30269.

Note: See TracTickets for help on using tickets.