mirror of
https://github.com/tmux/tmux.git
synced 2026-09-21 12:28:14 +00:00
cmd-run-shell: expand formats in -c start-directory
-c was taken as a literal string, so run-shell -c '#{pane_current_path}'
tried to chdir into that literal text instead of the target pane's
directory, silently falling back to the server's own cwd. Expand it
through a format tree built from the command's target the same way the
shell-command argument already is.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -163,9 +163,11 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item)
|
||||
}
|
||||
if (cdata->client != NULL)
|
||||
cdata->client->references++;
|
||||
if (args_has(args, 'c'))
|
||||
cdata->cwd = xstrdup(args_get(args, 'c'));
|
||||
else
|
||||
if (args_has(args, 'c')) {
|
||||
ft = format_create_from_target(item);
|
||||
cdata->cwd = format_expand(ft, args_get(args, 'c'));
|
||||
format_free(ft);
|
||||
} else
|
||||
cdata->cwd = xstrdup(server_client_get_cwd(c, s));
|
||||
|
||||
if (args_has(args, 'E'))
|
||||
|
||||
Reference in New Issue
Block a user