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:
nicm
2014-05-13 08:08:32 +00:00
parent b1a06ef22e
commit b3e8d440ed
12 changed files with 192 additions and 91 deletions

12
names.c
View File

@ -68,9 +68,15 @@ window_name_callback(unused int fd, unused short events, void *data)
char *
default_window_name(struct window *w)
{
if (w->active->cmd != NULL && *w->active->cmd != '\0')
return (parse_window_name(w->active->cmd));
return (parse_window_name(w->active->shell));
char *cmd, *s;
cmd = cmd_stringify_argv(w->active->argc, w->active->argv);
if (cmd != NULL && *cmd != '\0')
s = parse_window_name(cmd);
else
s = parse_window_name(w->active->shell);
free(cmd);
return (s);
}
char *