diff options
Diffstat (limited to 'config/chroot_local-includes/etc')
-rw-r--r-- | config/chroot_local-includes/etc/bash.bashrc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/config/chroot_local-includes/etc/bash.bashrc b/config/chroot_local-includes/etc/bash.bashrc index ea000a6..0fee152 100644 --- a/config/chroot_local-includes/etc/bash.bashrc +++ b/config/chroot_local-includes/etc/bash.bashrc @@ -29,13 +29,29 @@ PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' #esac # enable bash completion in interactive shells -if [ -f /etc/bash_completion ]; then +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi +# if the command-not-found package is installed, use it +if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then + function command_not_found_handle { + # check because c-n-f could've been removed in the meantime + if [ -x /usr/lib/command-not-found ]; then + /usr/bin/python /usr/lib/command-not-found -- "$1" + return $? + elif [ -x /usr/share/command-not-found ]; then + /usr/bin/python /usr/share/command-not-found -- "$1" + return $? + else + return 127 + fi + } +fi + # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then - eval "`dircolors -b`" + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' @@ -54,4 +70,3 @@ alias la='ls -A' alias l='ls -CF' alias ..='cd ..' alias cd..='cd ..' - |