diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-21 21:30:24 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-22 10:03:15 -0300 |
| commit | 4e89db185fa4e3bfe4358d2da3b76fad0cc7e547 (patch) | |
| tree | 7fe3609df076281e15a70520fb5bb8fb9714ca78 /src/config.zig | |
| parent | 02841e214442c7a602877883425757b0dab3f924 (diff) | |
| download | pardes-4e89db185fa4e3bfe4358d2da3b76fad0cc7e547.tar.gz pardes-4e89db185fa4e3bfe4358d2da3b76fad0cc7e547.zip | |
Esc in a raw terminal is pardes's; Shift-Esc goes to the program (ProgramEsc)
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/config.zig b/src/config.zig index 8166954d..f3cc0948 100644 --- a/src/config.zig +++ b/src/config.zig @@ -153,6 +153,7 @@ pub const leader_path = paths: { table.set(.JumpTrail, null); table.set(.ChipShadow, null); table.set(.ThumbFlash, null); + table.set(.ProgramEsc, null); if (builtins.capabilities.lift) table.set(.Lift, null); table.set(.Motion, null); table.set(.InactiveDim, null); @@ -283,8 +284,9 @@ pub const jump_keys = [_]struct { chord: Chord, cmd: Builtin }{ }; /// Shift-Esc: the Esc nothing swallows. In every mode and pane it does what -/// Esc does from normal mode, back to the previous pane (Last); a raw -/// terminal's program never sees it. Ctrl-b alone toggles raw. +/// Esc does from normal mode, back to the previous pane (Last); in a raw +/// terminal plain Esc does it and Shift-Esc is the program's Esc, unless +/// ProgramEsc is on. Ctrl-b alone toggles raw. pub const back_out: []const Chord = &.{.{ .cp = Key.escape, .shift = true }}; pub const tty_toggle_default: u21 = 'b'; @@ -764,6 +766,9 @@ pub const Runtime = struct { /// T7: in a terminal, a pane's scroll thumb brightens as it scrolls and /// fades back (truecolor terminals). thumb_flash: bool = false, + /// In a raw terminal, Esc goes to the program and Shift-Esc backs out + /// (off, the default: Esc backs out and Shift-Esc is the program's). + program_esc: bool = false, /// How long a message stays after the key or click that dismisses it. message_linger_ms: u16 = 800, /// How long its fall into the row takes, easing out (ยง8.1: arriving, @@ -1022,7 +1027,7 @@ pub const Runtime = struct { /// The message timings a setting word sets, each in milliseconds. pub const MessageTime = enum { linger, fall, dissolve }; - pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, syntax_bold, pager_color, verbose, message_animation, ligatures, cursor_blink, selection_glow, hover_glow, occlusion, parallax, jump_trail, chip_shadow, thumb_flash }; + pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, syntax_bold, pager_color, verbose, message_animation, ligatures, cursor_blink, selection_glow, hover_glow, occlusion, parallax, jump_trail, chip_shadow, thumb_flash, program_esc }; /// A bundled post pass, a Shadertoy file in shaders/post/: the CRT, and /// G4's bloom, vignette and grain (docs/effects.md). pub const Scene = enum { crt, bloom, vignette, grain }; @@ -1090,6 +1095,7 @@ pub const Runtime = struct { .{ .word = "JumpTrail", .action = .{ .toggle = .jump_trail }, .doc = "In a terminal, a jump of the cursor leaves a short trail that fades, on or off." }, .{ .word = "ChipShadow", .action = .{ .toggle = .chip_shadow }, .doc = "In a terminal, a notice chip casts a cell's shadow right and down, on or off." }, .{ .word = "ThumbFlash", .action = .{ .toggle = .thumb_flash }, .doc = "In a terminal, a pane's scroll thumb brightens as it scrolls and fades back, on or off." }, + .{ .word = "ProgramEsc", .action = .{ .toggle = .program_esc }, .doc = "In a raw terminal, Esc goes to the program and Shift-Esc backs out, on; off (the default) swaps them." }, .{ .word = "Lift", .action = .lift, .availability = .lift, .doc = "How the focused pane stands off the page: off, shadow, rim or auto." }, .{ .word = "Motion", .action = .motion, .doc = "How animations move: off, crisp, smooth, bouncy or playful." }, .{ .word = "InactiveDim", .action = .inactive_dim, .doc = "Fade the unfocused panes' text by a percentage, 0 through 100, 0 off." }, @@ -1876,6 +1882,7 @@ pub const Runtime = struct { .jump_trail => "JumpTrail on\n", .chip_shadow => "ChipShadow on\n", .thumb_flash => "ThumbFlash on\n", + .program_esc => "ProgramEsc on\n", }, .shell => "Shell fish\n", .tagline_size => "TaglineSize 73\n", |
