Skip to content

Commit c6b5e2b

Browse files
committed
Fix action enum shift crash from upstream SET_TAB_TITLE
Upstream added GHOSTTY_ACTION_SET_TAB_TITLE at position 33, shifting all subsequent enum values. Swift/Xcode couldn't import the new value, causing every action after position 33 to be misinterpreted (e.g. COMMAND_FINISHED matched as START_SEARCH, crashing on garbage pointer). Fix: move SET_TAB_TITLE to the end of the C ABI enum so existing values keep their positions. Handle it via raw value in Swift.
1 parent 83c2199 commit c6b5e2b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/GhosttyTerminalView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,7 @@ class GhosttyApp {
25922592
}
25932593
}
25942594
return true
2595-
case ghostty_action_tag_e(rawValue: 33): // GHOSTTY_ACTION_SET_TAB_TITLE
2595+
case ghostty_action_tag_e(rawValue: 64): // GHOSTTY_ACTION_SET_TAB_TITLE (moved to end to avoid shifting existing values)
25962596
let title = action.action.set_title.title
25972597
.flatMap { String(cString: $0) } ?? ""
25982598
if let tabId = surfaceView.tabId,

ghostty

0 commit comments

Comments
 (0)