mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-18 21:40:29 +00:00
apprt: show title override in command palette jump commands
This commit is contained in:
committed by
Mitchell Hashimoto
parent
e6da439e43
commit
f38234bc5b
@@ -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
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user