From dc8f08239235d85be875e03fc67148e8eaab758e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 20 Dec 2025 20:36:35 -0800 Subject: [PATCH] macos: copy the key table action bytes --- macos/Sources/Ghostty/Ghostty.Action.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/macos/Sources/Ghostty/Ghostty.Action.swift b/macos/Sources/Ghostty/Ghostty.Action.swift index bde3b3d69..91f1491dd 100644 --- a/macos/Sources/Ghostty/Ghostty.Action.swift +++ b/macos/Sources/Ghostty/Ghostty.Action.swift @@ -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