terminal: KAM (mode 2)

This has an associated config `vt-kam-allowed` which defaults to "false"
since this mode can cause the terminal to become mostly unusable. We
include this mode for completions sake however.
This commit is contained in:
Mitchell Hashimoto
2023-10-12 17:07:47 -07:00
parent f5a80f6b98
commit 6a065540dd
5 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import VTMode from "@/components/VTMode";
# Keyboard Action Mode (KAM)
<VTMode value={2} ansi={true} />
Disable all keyboard input.
This mode is unset as part of both [full reset (RIS)](/vt/ris)
and [soft reset (DECSTR)](/vt/decstr).
A poorly behaved terminal program can lock the terminal emulator
using this command. Terminal emulators should provide a mechanism
to reset this or outright disable it.
## Validation
### KAM V-1: Disable Keyboard Input
```bash
printf "\033[1;1H" # move to top-left
printf "\033[0J" # clear screen
printf "Keyboard input is now disabled.\n"
printf "\033[2h"
sleep 5
printf "\033[2l"
printf "Keyboard input is re-enabled.\n"
```

View File

@@ -0,0 +1,18 @@
export default function VTMode({
value,
ansi = false,
}: {
value: number;
ansi: boolean;
}) {
return (
<div className="flex my-2.5">
<div className="border px-1 grid grid-rows-2 grid-cols-1 text-center">
<div>
{ansi ? "?" : ""}
{value}
</div>
</div>
</div>
);
}