mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
set title as argv[0] for commands specified with -e
This commit is contained in:
@ -675,6 +675,22 @@ pub fn init(
|
||||
.set_title,
|
||||
.{ .title = title },
|
||||
);
|
||||
} else if (config.@"initial-command") |initial_command| {
|
||||
switch (initial_command) {
|
||||
// If a user specifies a command with `-e` it is appropriate to set the title
|
||||
// as argv[0]
|
||||
.direct => {
|
||||
_ = try rt_app.performAction(
|
||||
.{ .surface = self },
|
||||
.set_title,
|
||||
.{ .title = initial_command.direct[0] },
|
||||
);
|
||||
},
|
||||
// we won't set the title in the case the shell expands the command
|
||||
// as that should typically be used to launch a shell which should
|
||||
// set its own titles
|
||||
.shell => {},
|
||||
}
|
||||
}
|
||||
|
||||
// We are no longer the first surface
|
||||
|
Reference in New Issue
Block a user