mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 14:00:29 +00:00
macos: rectangle select only requires option + drag
Fixes #2537 This matches Terminal.app. iTerm2 requires cmd+option (our old behavior). Kitty doesn't seem to support rectangle select or I couldn't figure out how to make it work. WezTerm matches Terminal.app too. Outside of terminal emulators, this is also the rectangular select binding for neovim.
This commit is contained in:
@@ -113,14 +113,19 @@ fn eligibleMouseShapeKeyEvent(physical_key: input.Key) bool {
|
||||
physical_key.leftOrRightAlt();
|
||||
}
|
||||
|
||||
fn isRectangleSelectState(mods: input.Mods) bool {
|
||||
return mods.ctrlOrSuper() and mods.alt;
|
||||
}
|
||||
|
||||
fn isMouseModeOverrideState(mods: input.Mods) bool {
|
||||
return mods.shift;
|
||||
}
|
||||
|
||||
/// Returns true if our modifiers put us in a state where dragging
|
||||
/// should cause a rectangle select.
|
||||
pub fn isRectangleSelectState(mods: input.Mods) bool {
|
||||
return if (comptime builtin.target.isDarwin())
|
||||
mods.alt
|
||||
else
|
||||
mods.ctrlOrSuper() and mods.alt;
|
||||
}
|
||||
|
||||
test "keyToMouseShape" {
|
||||
const testing = std.testing;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user