aboutsummaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-05-05 09:30:15 -0400
committerRuss Cox <rsc@swtch.com>2020-05-05 09:30:39 -0400
commitacffdcb6eed3385e1566c0ac86fb6b4bc130664b (patch)
tree3931ea7884e68d15f41585c3c64b9b5aadcca047 /mac
parentb962b25ecaf6ddb11a36235d4a9849a147b4f6a3 (diff)
downloadplan9port-acffdcb6eed3385e1566c0ac86fb6b4bc130664b.tar.gz
plan9port-acffdcb6eed3385e1566c0ac86fb6b4bc130664b.tar.bz2
plan9port-acffdcb6eed3385e1566c0ac86fb6b4bc130664b.zip
9term.app: respect user-set shell instead of forcing bash
Diffstat (limited to 'mac')
-rwxr-xr-xmac/9term.app/Contents/MacOS/9term24
1 files changed, 22 insertions, 2 deletions
diff --git a/mac/9term.app/Contents/MacOS/9term b/mac/9term.app/Contents/MacOS/9term
index e5ef2735..b5a46bc8 100755
--- a/mac/9term.app/Contents/MacOS/9term
+++ b/mac/9term.app/Contents/MacOS/9term
@@ -1,9 +1,29 @@
#!/bin/bash
-cd $HOME
-. ~/.bashrc
+fshell=$(finger $(whoami) | sed -n 's/.*Shell: //p' | sed 1q)
+SHELL=${fshell:-$SHELL}
PLAN9=${PLAN9:-/usr/local/plan9}
+cd $HOME
+case "$SHELL" in
+*/rc)
+ echo '
+ if(! ~ $PLAN9/bin $path)
+ path=($path $PLAN9/bin)
+ $PLAN9/bin/9term -l -W600x800 &
+ ' | $SHELL -l
+ exit 0
+ ;;
+*/bash)
+ . ~/.bash_profile
+ ;;
+*)
+ . ~/.profile
+ ;;
+esac
+
if ! [[ :$PATH: =~ :$PLAN9/bin: ]]
then
PATH=$PATH:$PLAN9/bin
fi
$PLAN9/bin/9term -l -W600x800 &
+exit 0
+