macOS: treat C-/ specially again to prevent beep

Fixes #7310
This commit is contained in:
Mitchell Hashimoto
2025-05-10 14:50:56 -07:00
parent ed1194cd75
commit c4f1c78fcf
2 changed files with 10 additions and 11 deletions

View File

@@ -1066,6 +1066,16 @@ extension Ghostty {
equivalent = "\r"
case "/":
// Treat C-/ as C-_. We do this because C-/ makes macOS make a beep
// sound and we don't like the beep sound.
if (!event.modifierFlags.contains(.control) ||
!event.modifierFlags.isDisjoint(with: [.shift, .command, .option])) {
return false
}
equivalent = "_"
default:
// It looks like some part of AppKit sometimes generates synthetic NSEvents
// with a zero timestamp. We never process these at this point. Concretely,