From a6af9c6a1c18a9b83011d80ee924fe6a5f6cd591 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Tue, 11 Oct 2022 21:45:41 -0700 Subject: [PATCH] bash: use zsh if in a nix-shell --- .bashrc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 0ad5676..2291813 100644 --- a/.bashrc +++ b/.bashrc @@ -1,8 +1,12 @@ #!/bin/bash -# Blake's bashrc 99.99% of this is the default bashrc for manjaro, I just liked -# it so I took it. The main job of this is to load my basic shell -# configuration, which works in any `sh`-compatible shell +# Blake's bashrc + +# ZSH supremacy + +# 99.99% of this is the default bashrc for manjaro, I just liked it so I took +# it, and I don't use bash enough to care. The main job of this is to load my +# basic shell configuration, which works in any POSIX shell. # If not running interactively, don't do anything [[ $- != *i* ]] && return @@ -13,6 +17,11 @@ export SHELL_CONFIG_DIR="${SHELL_CONFIG_DIR:-"${XDG_CONFIG_HOME:-"$HOME/.config" # Source standard shell configuration [ -f "$SHELL_CONFIG_DIR/shrc" ] && source "$SHELL_CONFIG_DIR/shrc" +# if in nix shell, run zsh instead of bash - not sure if there's a better way to do this +if ! "${FORCE_BASH:-false}" && [ -n "$IN_NIX_SHELL" ]; then + SHELL="/etc/profiles/per-user/$USER/bin/zsh" exec zsh +fi + ### Manjaro default bashrc >>> colors() { local fgc bgc vals seq0