apprt: show title override in command palette jump commands

This commit is contained in:
Noah Bernsohn
2026-01-26 18:56:13 -06:00
committed by Mitchell Hashimoto
parent e6da439e43
commit f38234bc5b
2 changed files with 12 additions and 6 deletions

View File

@@ -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

View File

@@ -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| {