vt: Fix handling of backtab

PR: 292463
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2002
This commit is contained in:
Nathaniel Braun
2026-01-17 19:14:42 +02:00
committed by Warner Losh
parent 5beaa1ee75
commit 5fec99caff
3 changed files with 12 additions and 0 deletions
+6
View File
@@ -952,6 +952,9 @@ vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c)
VT_UNLOCK(vd);
break;
}
case BKEY | BTAB: /* Back tab (usually, shift+tab). */
terminal_input_special(vw->vw_terminal, TKEY_BTAB);
break;
case FKEY | F(1): case FKEY | F(2): case FKEY | F(3):
case FKEY | F(4): case FKEY | F(5): case FKEY | F(6):
case FKEY | F(7): case FKEY | F(8): case FKEY | F(9):
@@ -1964,6 +1967,9 @@ vtterm_cngetc(struct terminal *tm)
VTBUF_SLCK_DISABLE(&vw->vw_buf);
}
break;
case SPCLKEY | BTAB: /* Back tab (usually, shift+tab). */
vw->vw_kbdsq = "\x1b[Z";
break;
/* XXX: KDB can handle history. */
case SPCLKEY | FKEY | F(50): /* Arrow up. */
vw->vw_kbdsq = "\x1b[A";
+4
View File
@@ -703,6 +703,8 @@ static const char * const special_strings_cons25[] = {
[TKEY_F7] = "\x1B[S", [TKEY_F8] = "\x1B[T",
[TKEY_F9] = "\x1B[U", [TKEY_F10] = "\x1B[V",
[TKEY_F11] = "\x1B[W", [TKEY_F12] = "\x1B[X",
[TKEY_BTAB] = "\x1B[Z",
};
static const char * const special_strings_ckeys[] = {
@@ -726,6 +728,8 @@ static const char * const special_strings_normal[] = {
[TKEY_F7] = "\x1B[18~", [TKEY_F8] = "\x1B[19~",
[TKEY_F9] = "\x1B[20~", [TKEY_F10] = "\x1B[21~",
[TKEY_F11] = "\x1B[23~", [TKEY_F12] = "\x1B[24~",
[TKEY_BTAB] = "\x1B[Z",
};
const char *
+2
View File
@@ -206,6 +206,8 @@ void teken_set_winsize_noreset(teken_t *, const teken_pos_t *);
#define TKEY_F10 0x13
#define TKEY_F11 0x14
#define TKEY_F12 0x15
#define TKEY_BTAB 0x16
const char *teken_get_sequence(const teken_t *, unsigned int);
/* Legacy features. */