diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-01 19:42:55 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-01 19:42:55 +0000 |
commit | 22d1b9412e52c98cbdf52a3a5185a416c6d26c64 (patch) | |
tree | 9670391a25d42bf45bebf18f81729f5123704940 /tmux.c | |
parent | d50810267eb471a8a6739897efaf49e369e14c65 (diff) | |
download | rtmux-22d1b9412e52c98cbdf52a3a5185a416c6d26c64.tar.gz rtmux-22d1b9412e52c98cbdf52a3a5185a416c6d26c64.tar.bz2 rtmux-22d1b9412e52c98cbdf52a3a5185a416c6d26c64.zip |
Using -l to specify a login shell is non-POSIX and causes problems with shells
that do not support it. Instead, set an empty default-command to invoke $SHELL
with - prefixed to argv[0], and make this the default setting.
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.137 2009-06-25 16:56:08 nicm Exp $ */ +/* $Id: tmux.c,v 1.138 2009-07-01 19:42:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -218,7 +218,6 @@ main(int argc, char **argv) struct cmd *cmd; struct pollfd pfd; struct hdr hdr; - const char *shell; struct passwd *pw; char *s, *path, *label, *cause, *home, *pass = NULL; char cwd[MAXPATHLEN]; @@ -279,6 +278,7 @@ main(int argc, char **argv) options_init(&global_options, NULL); options_set_number(&global_options, "bell-action", BELL_ANY); options_set_number(&global_options, "buffer-limit", 9); + options_set_string(&global_options, "default-command", "%s", ""); options_set_number(&global_options, "display-time", 750); options_set_number(&global_options, "history-limit", 2000); options_set_number(&global_options, "lock-after-time", 0); @@ -368,17 +368,6 @@ main(int argc, char **argv) } xfree(label); - shell = getenv("SHELL"); - if (shell == NULL || *shell == '\0') { - pw = getpwuid(getuid()); - if (pw != NULL) - shell = pw->pw_shell; - if (shell == NULL || *shell == '\0') - shell = _PATH_BSHELL; - } - options_set_string( - &global_options, "default-command", "exec %s -l", shell); - if (getcwd(cwd, sizeof cwd) == NULL) { pw = getpwuid(getuid()); if (pw->pw_dir != NULL && *pw->pw_dir != '\0') |