mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
csi_modifier_param() builds the xterm modifier parameter from
shift_state, counting KG_SHIFTL/KG_SHIFTR as Shift, KG_ALTGR as Alt
and KG_CTRLL/KG_CTRLR as Ctrl in addition to the canonical KG_SHIFT,
KG_ALT and KG_CTRL.
That is wrong when those weights are not plain modifiers. Keymaps
derived from XKB layouts (by kbd's xkbsupport, and by the
console-setup used in Debian, Ubuntu and others) encode the active
layout group using KG_SHIFTL/KG_SHIFTR:
group 1: -
group 2: shiftl
group 3: shiftr
group 4: shiftl | shiftr
So while a non-default layout group is selected, KG_SHIFTL and/or
KG_SHIFTR are set in shift_state with no Shift key held.
csi_modifier_param() then adds a spurious Shift to every cursor and
CSI key: pressing Up while group 2 is active emits ESC[1;2A (Shift+Up)
instead of ESC[A. KG_ALTGR has the same problem since it is the
standard third-level selector.
Normal keymaps bind the physical Shift/Ctrl/Alt keys to KG_SHIFT,
KG_CTRL and KG_ALT, leaving the left/right and AltGr weights free for
layout and level selection. Count only those canonical weights, so
genuine modifiers are still encoded while layout/level selectors are
not.
Fixes:
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| conmakehash.c | ||
| consolemap.c | ||
| cp437.uni | ||
| defkeymap.c_shipped | ||
| defkeymap.map | ||
| gen_ucs_fallback_table.py | ||
| gen_ucs_recompose_table.py | ||
| gen_ucs_width_table.py | ||
| keyboard.c | ||
| Makefile | ||
| selection.c | ||
| ucs_fallback_table.h_shipped | ||
| ucs_recompose_table.h_shipped | ||
| ucs_width_table.h_shipped | ||
| ucs.c | ||
| vc_screen.c | ||
| vt_ioctl.c | ||
| vt.c | ||