Research Pattern
Identify the target host and VT first. Run session probes in that target session, or ask the user to run them there:
tty
printf '%s\n' "$TERM"
The agent's pty or missing tty does not rule out a separate target VT.
Inspect capabilities with infocmp -1 linux; terminfo lookup is not target detection.
Run device probes below only on the target host.
Man pages:
man console_codes | col -b
man setterm | col -b
man vconsole.conf | col -b
man loadkeys | col -b
man keymaps | col -b
man dumpkeys | col -b
man showkey | col -b
man setfont | col -b
man reset | col -b
man terminfo | col -b
man vcs | col -b
man ioctl_console | col -b
Useful probes:
infocmp -1 linux | grep -E '^(\s*(clear|rs[123]|is[123]|oc|op|initc|sgr0)=)'
dumpkeys | head
kbd_mode
fgconsole 2>/dev/null
ls -l /dev/tty[0-9]* /dev/vcs* /dev/vcsa* 2>/dev/null
If local docs are missing/stale, fetch current upstream docs:
- https://man7.org/linux/man-pages/man4/console_codes.4.html
- https://man7.org/linux/man-pages/man1/setterm.1.html
- https://man7.org/linux/man-pages/man5/vconsole.conf.5.html
- https://man7.org/linux/man-pages/man1/loadkeys.1.html
- https://man7.org/linux/man-pages/man5/keymaps.5.html
- https://man7.org/linux/man-pages/man8/setfont.8.html
- https://man7.org/linux/man-pages/man1/clear.1.html
- https://man7.org/linux/man-pages/man1/reset.1.html
- https://man7.org/linux/man-pages/man5/terminfo.5.html
- https://man7.org/linux/man-pages/man4/vcs.4.html
- https://man7.org/linux/man-pages/man2/ioctl_console.2.html
Distro docs can explain policy/integration. Prefer upstream man pages for interfaces, distro wiki for packaging/persistence quirks.