From 9a52ef099a28eb1c80f265d122567a4ccf31ba3a Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 12 Aug 2009 09:14:25 +0000 Subject: When started as the shell, __progname contains a leading -, so hardcode "tmux" for socket path and log files, and strip it when working out the shell. --- window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'window.c') diff --git a/window.c b/window.c index d24d789b..cfef2b24 100644 --- a/window.c +++ b/window.c @@ -62,6 +62,7 @@ const char * window_default_command(void) { const char *shell, *ptr; + char *progname; struct passwd *pw; shell = getenv("SHELL"); @@ -81,7 +82,10 @@ found: ptr++; else ptr = shell; - if (strcmp(ptr, __progname) == 0) + progname = __progname; + if (*progname == '-') + progname++; + if (strcmp(ptr, progname) == 0) return (_PATH_BSHELL); return (shell); } -- cgit