mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
If multiple arguments are given to new-session, new-window,
split-window, respawn-window or respawn-pane, pass them directly to execvp() to help avoid quoting problems. One argument still goes to "sh -c" like before. Requested by many over the years. Patch from J Raynor.
This commit is contained in:
8
format.c
8
format.c
@ -368,7 +368,7 @@ format_get_command(struct window_pane *wp)
|
||||
cmd = get_proc_name(wp->fd, wp->tty);
|
||||
if (cmd == NULL || *cmd == '\0') {
|
||||
free(cmd);
|
||||
cmd = xstrdup(wp->cmd);
|
||||
cmd = cmd_stringify_argv(wp->argc, wp->argv);
|
||||
if (cmd == NULL || *cmd == '\0') {
|
||||
free(cmd);
|
||||
cmd = xstrdup(wp->shell);
|
||||
@ -559,8 +559,10 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
||||
if (wp->tty != NULL)
|
||||
format_add(ft, "pane_tty", "%s", wp->tty);
|
||||
format_add(ft, "pane_pid", "%ld", (long) wp->pid);
|
||||
if (wp->cmd != NULL)
|
||||
format_add(ft, "pane_start_command", "%s", wp->cmd);
|
||||
if ((cmd = cmd_stringify_argv(wp->argc, wp->argv)) != NULL) {
|
||||
format_add(ft, "pane_start_command", "%s", cmd);
|
||||
free(cmd);
|
||||
}
|
||||
if ((cmd = format_get_command(wp)) != NULL) {
|
||||
format_add(ft, "pane_current_command", "%s", cmd);
|
||||
free(cmd);
|
||||
|
Reference in New Issue
Block a user