mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-28 17:14:39 +00:00
macos: copy the key table action bytes
This commit is contained in:
@@ -150,12 +150,8 @@ extension Ghostty.Action {
|
||||
init?(c: ghostty_action_key_table_s) {
|
||||
switch c.tag {
|
||||
case GHOSTTY_KEY_TABLE_ACTIVATE:
|
||||
let name = String(
|
||||
bytesNoCopy: UnsafeMutableRawPointer(mutating: c.value.activate.name),
|
||||
length: c.value.activate.len,
|
||||
encoding: .utf8,
|
||||
freeWhenDone: false
|
||||
) ?? ""
|
||||
let data = Data(bytes: c.value.activate.name, count: c.value.activate.len)
|
||||
let name = String(data: data, encoding: .utf8) ?? ""
|
||||
self = .activate(name: name)
|
||||
case GHOSTTY_KEY_TABLE_DEACTIVATE:
|
||||
self = .deactivate
|
||||
|
||||
Reference in New Issue
Block a user