1 Use $SHELL instead of hardcoding /bin/sh in ratpoison.
3 Patch by Mark H Weaver <mhw@netris.org>.
5 --- ratpoison/src/actions.c.orig 2014-09-14 16:46:08.000000000 +0200
6 +++ ratpoison/src/actions.c 2015-08-06 15:00:54.951575260 +0200
8 add_command ("escape", cmd_escape, 1, 1, 1,
10 add_command ("exec", cmd_exec, 1, 1, 1,
11 - "/bin/sh -c ", arg_SHELLCMD);
12 + "$SHELL -c ", arg_SHELLCMD);
13 add_command ("execa", cmd_execa, 1, 1, 1,
14 - "/bin/sh -c ", arg_SHELLCMD);
15 + "$SHELL -c ", arg_SHELLCMD);
16 add_command ("execf", cmd_execf, 2, 2, 2,
17 "frame to execute in:", arg_FRAME,
18 - "/bin/sh -c ", arg_SHELLCMD);
19 + "$SHELL -c ", arg_SHELLCMD);
20 add_command ("fdump", cmd_fdump, 1, 0, 0,
22 add_command ("focus", cmd_next_frame, 0, 0, 0);
24 add_command ("unsetenv", cmd_unsetenv, 1, 1, 1,
25 "Variable: ", arg_STRING);
26 add_command ("verbexec", cmd_verbexec, 1, 1, 1,
27 - "/bin/sh -c ", arg_SHELLCMD);
28 + "$SHELL -c ", arg_SHELLCMD);
29 add_command ("version", cmd_version, 0, 0, 0);
30 add_command ("vsplit", cmd_v_split, 1, 0, 0,
31 "Split: ", arg_STRING);
39 /* Some process setup to make sure the spawned process runs
40 in its own session. */
41 putenv(current_screen()->display_string);
42 @@ -2700,7 +2703,18 @@
43 /* raw means don't run it through sh. */
45 execl (cmd, cmd, (char *)NULL);
46 - execl("/bin/sh", "sh", "-c", cmd, (char *)NULL);
48 + shell_path = getenv ("SHELL");
49 + if (shell_path == NULL)
50 + shell_path = "/bin/sh";
52 + shell_name = strrchr (shell_path, '/');
53 + if (shell_name == NULL)
54 + shell_name = shell_path;
58 + execl(shell_path, shell_name, "-c", cmd, (char *)NULL);
62 --- ratpoison/src/events.c.orig 2014-09-14 16:46:23.000000000 +0200
63 +++ ratpoison/src/events.c 2015-08-06 15:02:17.287578780 +0200
66 /* Report any child that didn't return 0. */
68 - marked_message_printf (0,0, "/bin/sh -c \"%s\" finished (%d)",
69 + marked_message_printf (0,0, "$SHELL -c \"%s\" finished (%d)",
70 cur->cmd, cur->status);
71 list_del (&cur->node);
73 --- ratpoison/src/messages.h.orig 2014-04-09 01:22:08.000000000 +0200
74 +++ ratpoison/src/messages.h 2015-08-06 15:04:14.759583801 +0200
77 #define MESSAGE_PROMPT_SWITCH_TO_WINDOW "Switch to window: "
78 #define MESSAGE_PROMPT_NEW_WINDOW_NAME "Set window's title to: "
79 -#define MESSAGE_PROMPT_SHELL_COMMAND "/bin/sh -c "
80 +#define MESSAGE_PROMPT_SHELL_COMMAND "$SHELL -c "
81 #define MESSAGE_PROMPT_COMMAND ":"
82 #define MESSAGE_PROMPT_SWITCH_WM "Switch to wm: "
83 #define MESSAGE_PROMPT_XTERM_COMMAND MESSAGE_PROMPT_SHELL_COMMAND TERM_PROG " -e "