macos: ensure tab labels are always visible

This tells AppKit to give the tab labels higher priority than the tab
titles. When the tabs become small, this causes the tab title text to be
truncated instead of dropping the tab label.

Fixes: https://github.com/mitchellh/ghostty/issues/843
This commit is contained in:
Gregory Anders
2023-11-08 08:48:20 -06:00
parent e542215c21
commit dffb5e9f15

View File

@ -90,6 +90,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
]
let attributedString = NSAttributedString(string: " \(equiv) ", attributes: attributes)
let text = NSTextField(labelWithAttributedString: attributedString)
text.setContentCompressionResistancePriority(.windowSizeStayPut, for: .horizontal)
window.tab.accessoryView = text
}
}