aboutsummaryrefslogtreecommitdiff
path: root/config.def.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-09-21 21:14:59 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-09-21 21:14:59 -0700
commit149056033a6dc5deb0adc42f591517dcbe2d8a47 (patch)
treea4556a097ef3952542f41065931741bb8f468ad0 /config.def.h
parentca626182c1ba6573a81f55f5257fea9cb6800fb8 (diff)
Added support for default shell other than sh (e.g. dash, in case sh
links to bash)
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h
index e8d1d3e..498f03c 100644
--- a/config.def.h
+++ b/config.def.h
@@ -91,6 +91,10 @@ typedef struct {
#define DIR_COLOR "\033[34m"
#define EXECUTABLE_COLOR "\033[31m"
+#ifndef SH
+#define SH "sh"
+#endif
+
// Some handy macros for common shell script behaviors:
#define PAUSE " read -n1 -p '\033[2mPress any key to continue...\033[0m\033[?25l' >/dev/tty </dev/tty"
@@ -249,9 +253,9 @@ binding_t bindings[] = {
"{ if [ $type = File ]; then touch \"$name\"; else mkdir \"$name\"; fi "
"&& bb \"+goto:$name\" +r || "PAUSE"; }", B("New")" file/directory"},
{{'p'}, "$PAGER \"$@\"", B("Page")" through a file in $PAGER"},
- {{'|'}, ASK("cmd", "|", "") " && printf '%s\\n' \"$@\" | sh -c \"$BBSHELLFUNC$cmd\"; " PAUSE "; bb +r",
+ {{'|'}, ASK("cmd", "|", "") " && printf '%s\\n' \"$@\" | "SH" -c \"$BBSHELLFUNC$cmd\"; " PAUSE "; bb +r",
B("Pipe")" selected files to a command"},
- {{':'}, ASK("cmd", ":", "")" && sh -c \"$BBSHELLFUNC$cmd\" -- \"$@\"; " PAUSE "; bb +refresh",
+ {{':'}, ASK("cmd", ":", "")" && "SH" -c \"$BBSHELLFUNC$cmd\" -- \"$@\"; " PAUSE "; bb +refresh",
B("Run")" a command"},
{{'>'}, "tput rmcup >/dev/tty; $SHELL; bb +r", "Open a "B("shell")},
{{'r', KEY_F2},