mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-31 10:42:12 +00:00
macos: do not send UTF-8 PUA codepoints to key events
Fixes #7337 AppKit encodes functional keys as PUA codepoints. We don't want to send that down as valid text encoding for a key event because KKP uses that in particular to change the encoding with associated text. I think there may be a more specific solution to this by only doing this within the KKP encoding part of KeyEncoder but that was filled with edge cases and I didn't want to risk breaking anything else.
This commit is contained in:
@@ -146,7 +146,9 @@ fn kitty(
|
||||
// the real world issue is usually control characters.
|
||||
const view = try std.unicode.Utf8View.init(self.event.utf8);
|
||||
var it = view.iterator();
|
||||
while (it.nextCodepoint()) |cp| if (isControl(cp)) break :plain_text;
|
||||
while (it.nextCodepoint()) |cp| {
|
||||
if (isControl(cp)) break :plain_text;
|
||||
}
|
||||
|
||||
return try copyToBuf(buf, self.event.utf8);
|
||||
}
|
||||
@@ -212,7 +214,9 @@ fn kitty(
|
||||
}
|
||||
}
|
||||
|
||||
if (self.kitty_flags.report_associated and seq.event != .release) associated: {
|
||||
if (self.kitty_flags.report_associated and
|
||||
seq.event != .release)
|
||||
associated: {
|
||||
// Determine if the Alt modifier should be treated as an actual
|
||||
// modifier (in which case it prevents associated text) or as
|
||||
// the macOS Option key, which does not prevent associated text.
|
||||
|
||||
Reference in New Issue
Block a user