From 20d922e7984ad22964f31a1a3fe3377ed23d4c4a Mon Sep 17 00:00:00 2001 From: beeb5k Date: Sun, 7 Jun 2026 12:29:22 +0530 Subject: Bash is what god intended us to use --- common/programs/bash.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 common/programs/bash.nix (limited to 'common/programs/bash.nix') diff --git a/common/programs/bash.nix b/common/programs/bash.nix new file mode 100644 index 0000000..1ad9e80 --- /dev/null +++ b/common/programs/bash.nix @@ -0,0 +1,41 @@ +{ + programs.bash = { + enable = true; + historySize = 10000; + historyFile = "$HOME/.bash_history"; + historyControl = [ + "ignorespace" + "erasedups" + ]; + initExtra = '' + shopt -s histappend + + bind "set completion-ignore-case on" + bind "set show-all-if-ambiguous on" + + bind '"\e[Z": menu-complete-backward' + + bind '"\e[A": history-search-backward' + bind '"\e[B": history-search-forward' + + + if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then + # Removed the '1;' prefix to disable bold + PROMPT_COLOR="31m" + ((UID)) && PROMPT_COLOR="32m" + + if [ -n "$INSIDE_EMACS" ]; then + PS1="\[\033[$PROMPT_COLOR\]\u@\h:\w\\$\[\033[0m\] " + else + # PS1="\[\033[$PROMPT_COLOR\]\[\e]0;\u@\h: \w\a\]\u@\h:\w\\$\[\033[0m\] " + PS1="\[\e[38;5;75m\]\u@\h \[\e[38;5;113m\]\w \[\e[38;5;189m\]\$ \[\e[0m\]" + fi + + if test "$TERM" = "xterm"; then + PS1="\[\033]2;\h:\u:\w\007\]$PS1" + fi + fi + ''; + }; + +} -- cgit v1.3.1