From b3e8d440ed0477e88232c3ba1779c67eafce3a48 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 13 May 2014 08:08:32 +0000 Subject: 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. --- names.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'names.c') diff --git a/names.c b/names.c index cfdaff83..8e01d347 100644 --- a/names.c +++ b/names.c @@ -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 * -- cgit v1.2.3