Merge pull request #2856 from ghostty-org/push-nmsumxnrsyrq

macos: unicode keybindings must convert to string properly
This commit is contained in:
Mitchell Hashimoto
2024-11-29 14:31:19 -08:00
committed by GitHub
2 changed files with 25 additions and 15 deletions

View File

@ -50,7 +50,8 @@ extension Ghostty {
} }
case GHOSTTY_TRIGGER_UNICODE: case GHOSTTY_TRIGGER_UNICODE:
equiv = String(trigger.key.unicode) guard let scalar = UnicodeScalar(trigger.key.unicode) else { return nil }
equiv = String(scalar)
default: default:
return nil return nil

View File

@ -1454,6 +1454,7 @@ pub const Set = struct {
}; };
// If we have any leaders we need to clone them. // If we have any leaders we need to clone them.
{
var it = result.bindings.iterator(); var it = result.bindings.iterator();
while (it.next()) |entry| switch (entry.value_ptr.*) { while (it.next()) |entry| switch (entry.value_ptr.*) {
// Leaves could have data to clone (i.e. text actions // Leaves could have data to clone (i.e. text actions
@ -1469,6 +1470,14 @@ pub const Set = struct {
s.* = ptr; s.* = ptr;
}, },
}; };
}
// We need to clone the action keys in the reverse map since
// they may contain allocated values.
{
var it = result.reverse.keyIterator();
while (it.next()) |action| action.* = try action.clone(alloc);
}
return result; return result;
} }