diff options
author | nicm <nicm> | 2014-05-13 08:08:32 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-05-13 08:08:32 +0000 |
commit | b3e8d440ed0477e88232c3ba1779c67eafce3a48 (patch) | |
tree | 09e92eb59a30d393132b4da6d8cc3d3623f755b2 /format.c | |
parent | b1a06ef22e54e943d733db8dcc98fe60051c93de (diff) | |
download | rtmux-b3e8d440ed0477e88232c3ba1779c67eafce3a48.tar.gz rtmux-b3e8d440ed0477e88232c3ba1779c67eafce3a48.tar.bz2 rtmux-b3e8d440ed0477e88232c3ba1779c67eafce3a48.zip |
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.
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |