mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-20 20:04:26 +00:00
Implement "Paste Selection" on macOS like Terminal.app
This commit is contained in:
committed by
Mitchell Hashimoto
parent
29c2f095a6
commit
e86b9a112e
@@ -1389,13 +1389,10 @@ keybind: Keybinds = .{},
|
||||
/// and the system clipboard on macOS. Middle-click paste is always enabled
|
||||
/// even if this is `false`.
|
||||
///
|
||||
/// The default value is true on Linux and false on macOS. macOS copy on
|
||||
/// select behavior is not typical for applications so it is disabled by
|
||||
/// default. On Linux, this is a standard behavior so it is enabled by
|
||||
/// default.
|
||||
/// The default value is true on Linux and macOS.
|
||||
@"copy-on-select": CopyOnSelect = switch (builtin.os.tag) {
|
||||
.linux => .true,
|
||||
.macos => .false,
|
||||
.macos => .true,
|
||||
else => .false,
|
||||
},
|
||||
|
||||
@@ -2749,6 +2746,13 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
|
||||
.{ .toggle_fullscreen = {} },
|
||||
);
|
||||
|
||||
// Selection clipboard paste, matches Terminal.app
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .translated = .v }, .mods = .{ .super = true, .shift = true } },
|
||||
.{ .paste_from_selection = {} },
|
||||
);
|
||||
|
||||
// "Natural text editing" keybinds. This forces these keys to go back
|
||||
// to legacy encoding (not fixterms). It seems macOS users more than
|
||||
// others are used to these keys so we set them as defaults. If
|
||||
|
||||
Reference in New Issue
Block a user