website: document srm mode

This commit is contained in:
Mitchell Hashimoto
2023-10-12 19:38:06 -07:00
parent 89d2827910
commit 853c0427e6
2 changed files with 20 additions and 1 deletions

View File

@ -147,6 +147,7 @@ pub fn modeFromInt(v: u16, ansi: bool) ?Mode {
}
fn entryForMode(comptime mode: Mode) ModeEntry {
@setEvalBranchQuota(10_000);
const name = @tagName(mode);
for (entries) |entry| {
if (std.mem.eql(u8, entry.name, name)) return entry;
@ -172,6 +173,7 @@ const entries: []const ModeEntry = &.{
// ANSI
.{ .name = "disable_keyboard", .value = 2, .ansi = true }, // KAM
.{ .name = "insert", .value = 4, .ansi = true },
.{ .name = "send_receive_mode", .value = 12, .ansi = true, .default = true }, // SRM
// DEC
.{ .name = "cursor_keys", .value = 1 }, // DECCKM
@ -213,7 +215,7 @@ test modeFromInt {
try testing.expect(modeFromInt(4, true).? == .insert);
try testing.expect(modeFromInt(9, true) == null);
try testing.expect(modeFromInt(9, false).? == .mouse_event_x10);
try testing.expect(modeFromInt(12, true) == null);
try testing.expect(modeFromInt(14, true) == null);
}
test ModeState {

View File

@ -0,0 +1,17 @@
import VTMode from "@/components/VTMode";
# Send-Receive Mode (SRM)
<VTMode value={12} ansi={true} />
If reset, characters entered by the keyboard are shown on the screen
as well as being sent to the running program. If set, keyboard input
is sent only to the running program and the running program can choose
whether it wants to echo it back.
This mode is typically enabled on terminal startup.
This mode is generally unsupported across most terminals today and
is recommended to be retired.[^1]
[^1]: https://gitlab.gnome.org/GNOME/vte/-/issues/69