Skip to content

Commit c229188

Browse files
committed
Improve zsh loading in bashrc
1 parent eeb3037 commit c229188

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.bashrc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,21 @@
66
if [[ $- == *i* ]]; then
77
if command -v zsh &> /dev/null; then
88
# https://askubuntu.com/a/1292415
9-
export SHELL=`which zsh`
10-
zsh
9+
export SHELL=$(which zsh)
10+
11+
# https://stackoverflow.com/a/10341338
12+
# https://askubuntu.com/a/525787
13+
if [[ -o login ]]; then
14+
exec zsh -l
15+
else
16+
exec zsh
17+
fi
18+
19+
# The exec command replaces the current shell and therefore terminates the reading of this file.
20+
# if [ $? -eq 0 ]; then
21+
# return 0
22+
# else
23+
# echo "There was an issue in running zsh. Please check your configuration. Dropping to bash shell."
24+
# fi
1125
fi
1226
fi

0 commit comments

Comments
 (0)