From f38234bc5bf7c3c6e9688c6129718b04d1fd9366 Mon Sep 17 00:00:00 2001 From: Noah Bernsohn Date: Mon, 26 Jan 2026 18:56:13 -0600 Subject: [PATCH 1/4] apprt: show title override in command palette jump commands --- .../Command Palette/TerminalCommandPalette.swift | 11 +++++++++-- src/apprt/gtk/class/command_palette.zig | 7 +++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift index 70d1273a2..09e369d4a 100644 --- a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift +++ b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift @@ -143,8 +143,15 @@ struct TerminalCommandPaletteView: View { let displayColor = color != TerminalTabColor.none ? color : nil return controller.surfaceTree.map { surface in - let title = surface.title.isEmpty ? window.title : surface.title - let displayTitle = title.isEmpty ? "Untitled" : title + let terminalTitle = surface.title.isEmpty ? window.title : surface.title + let displayTitle: String + if let override = controller.titleOverride, !override.isEmpty { + displayTitle = override + } else if !terminalTitle.isEmpty { + displayTitle = terminalTitle + } else { + displayTitle = "Untitled" + } let pwd = surface.pwd?.abbreviatedPath let subtitle: String? = if let pwd, !displayTitle.contains(pwd) { pwd diff --git a/src/apprt/gtk/class/command_palette.zig b/src/apprt/gtk/class/command_palette.zig index 0d91c43b2..4a3e799c2 100644 --- a/src/apprt/gtk/class/command_palette.zig +++ b/src/apprt/gtk/class/command_palette.zig @@ -691,12 +691,12 @@ const Command = extern struct { defer surface.unref(); const alloc = priv.arena.allocator(); - const surface_title = surface.getTitle() orelse "Untitled"; + const effective_title = surface.getTitleOverride() orelse surface.getTitle() orelse "Untitled"; j.title = std.fmt.allocPrintSentinel( alloc, "Focus: {s}", - .{surface_title}, + .{effective_title}, 0, ) catch null; @@ -717,8 +717,7 @@ const Command = extern struct { defer surface.unref(); const alloc = priv.arena.allocator(); - - const title = surface.getTitle() orelse "Untitled"; + const title = surface.getTitleOverride() orelse surface.getTitle() orelse "Untitled"; const pwd = surface.getPwd(); if (pwd) |p| { From 62c1d50757218db6e9458a91364bea2e7886d316 Mon Sep 17 00:00:00 2001 From: Noah Bernsohn Date: Tue, 27 Jan 2026 09:01:37 -0600 Subject: [PATCH 2/4] Update macos/Sources/Features/Command Palette/TerminalCommandPalette.swift Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com> --- .../Features/Command Palette/TerminalCommandPalette.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift index 09e369d4a..d367f1e29 100644 --- a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift +++ b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift @@ -143,12 +143,11 @@ struct TerminalCommandPaletteView: View { let displayColor = color != TerminalTabColor.none ? color : nil return controller.surfaceTree.map { surface in - let terminalTitle = surface.title.isEmpty ? window.title : surface.title let displayTitle: String if let override = controller.titleOverride, !override.isEmpty { displayTitle = override } else if !terminalTitle.isEmpty { - displayTitle = terminalTitle + displayTitle = surface.title.isEmpty ? window.title : surface.title } else { displayTitle = "Untitled" } From c4766dff77d5c11c9279d83b5b3c75fc526279e5 Mon Sep 17 00:00:00 2001 From: Noah Bernsohn Date: Sat, 14 Feb 2026 12:27:03 -0600 Subject: [PATCH 3/4] fix: restore terminalTitle variable removed in previous edit --- .../Features/Command Palette/TerminalCommandPalette.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift index d367f1e29..09e369d4a 100644 --- a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift +++ b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift @@ -143,11 +143,12 @@ struct TerminalCommandPaletteView: View { let displayColor = color != TerminalTabColor.none ? color : nil return controller.surfaceTree.map { surface in + let terminalTitle = surface.title.isEmpty ? window.title : surface.title let displayTitle: String if let override = controller.titleOverride, !override.isEmpty { displayTitle = override } else if !terminalTitle.isEmpty { - displayTitle = surface.title.isEmpty ? window.title : surface.title + displayTitle = terminalTitle } else { displayTitle = "Untitled" } From 9fe3cc125d76530d095c78510fa5e6fb1f6be5ac Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Feb 2026 07:18:37 -0800 Subject: [PATCH 4/4] apprt/gtk: use new get effective title --- src/apprt/gtk/class/command_palette.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apprt/gtk/class/command_palette.zig b/src/apprt/gtk/class/command_palette.zig index 4a3e799c2..9c79f2712 100644 --- a/src/apprt/gtk/class/command_palette.zig +++ b/src/apprt/gtk/class/command_palette.zig @@ -691,7 +691,7 @@ const Command = extern struct { defer surface.unref(); const alloc = priv.arena.allocator(); - const effective_title = surface.getTitleOverride() orelse surface.getTitle() orelse "Untitled"; + const effective_title = surface.getEffectiveTitle() orelse "Untitled"; j.title = std.fmt.allocPrintSentinel( alloc, @@ -717,7 +717,7 @@ const Command = extern struct { defer surface.unref(); const alloc = priv.arena.allocator(); - const title = surface.getTitleOverride() orelse surface.getTitle() orelse "Untitled"; + const title = surface.getEffectiveTitle() orelse "Untitled"; const pwd = surface.getPwd(); if (pwd) |p| {