Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@ export function useTerminalTitle(title: string | TerminalTitlePair | null): void
}

if (process.platform === 'win32') {
const clean = stripAnsi(typeof title === 'string' ? title : title.window ?? title.tab ?? '')
const clean = stripAnsi(typeof title === 'string' ? title : (title.window ?? title.tab ?? ''))
process.title = clean

return
}

if (typeof title === 'string') {
writeRaw(osc(OSC.SET_TITLE_AND_ICON, stripAnsi(title)))

return
}

// Separate tab (OSC 1) and window (OSC 2) titles so narrow tab bars
// show the short session name instead of a truncated tail.
const tab = stripAnsi(title.tab ?? '')
const window = stripAnsi(title.window ?? '')

if (tab && window) {
writeRaw(osc(OSC.SET_ICON, tab) + osc(OSC.SET_TITLE, window))
} else if (window) {
Expand Down
2 changes: 1 addition & 1 deletion ui-tui/src/app/useMainApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export function useMainApp(gw: GatewayClient) {
model
? {
tab: composeTabTitle(marker, ui.sessionTitle, '', ''),
window: composeTabTitle(marker, ui.sessionTitle, model, tabCwd ? shortCwd(tabCwd, 24) : ''),
window: composeTabTitle(marker, ui.sessionTitle, model, tabCwd ? shortCwd(tabCwd, 24) : '')
}
: 'Hermes'
)
Expand Down
Loading