Skip to content

Commit c8d72ab

Browse files
authored
config: revert cmd/alt+left/right to legacy encoding on macOS by default (#3107)
Fixes #3106 Related to #2838 Discussion in #2363 This breaks fixterms encodings for these specific keys so that shells and other programs that rely on the legacy encoding for these keys will work by default. This only does this for macOS because for whatever reason during the large beta period, only macOS users found this as lacking. If users want to restore fixterms behaviors, they can rebind these keys as `unbind`.
2 parents 44e1c0f + 5bb2c62 commit c8d72ab

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/config/Config.zig

+26
Original file line numberDiff line numberDiff line change
@@ -2532,6 +2532,32 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
25322532
.{ .key = .{ .translated = .f }, .mods = .{ .super = true, .ctrl = true } },
25332533
.{ .toggle_fullscreen = {} },
25342534
);
2535+
2536+
// "Natural text editing" keybinds. This forces these keys to go back
2537+
// to legacy encoding (not fixterms). It seems macOS users more than
2538+
// others are used to these keys so we set them as defaults. If
2539+
// people want to get back to the fixterm encoding they can set
2540+
// the keybinds to `unbind`.
2541+
try result.keybind.set.put(
2542+
alloc,
2543+
.{ .key = .{ .translated = .right }, .mods = .{ .super = true } },
2544+
.{ .text = "\x05" },
2545+
);
2546+
try result.keybind.set.put(
2547+
alloc,
2548+
.{ .key = .{ .translated = .left }, .mods = .{ .super = true } },
2549+
.{ .text = "\x01" },
2550+
);
2551+
try result.keybind.set.put(
2552+
alloc,
2553+
.{ .key = .{ .translated = .left }, .mods = .{ .alt = true } },
2554+
.{ .esc = "b" },
2555+
);
2556+
try result.keybind.set.put(
2557+
alloc,
2558+
.{ .key = .{ .translated = .right }, .mods = .{ .alt = true } },
2559+
.{ .esc = "f" },
2560+
);
25352561
}
25362562

25372563
// Add our default link for URL detection

0 commit comments

Comments
 (0)