#! bash # Sets up the shell for interactive commands # Use the terminfo backspace character as the erase character. This is not # enabled by default because terminfo is often broken. #stty erase $(tput kbs) # The contents of /etc/debian_chroot will be printed in the prompt. You can # create this file in chroot environments to know where you are. if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # Prompt: user@host:directory$ PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' # The all important colours! ssource "${HOME}/.bash/colors" # xterm titlebar displays current command case "${TERM}" in xterm*|rxvt*) HOSTNAME="$(hostname | cut -d '.' -f 1)" CWD_WITHHOME='"$(echo "${PWD}" | sed "s|^${HOME}|~|")"' PROMPT_COMMAND="echo -ne \"\033]0;${HOSTNAME}: ${CWD_WITHHOME}\007\"" unset HOSTNAME ;; screen*) PROMPT_COMMAND="echo -ne '\033k\033\\'" ;; *) ;; esac # Useful aliases alias ls='ls --color=auto' alias ll='ls -hlF' alias la='ls -ha' alias l='ls -halF' alias rm='rm -i' alias less='less -R' alias grep='grep --color=auto' # Bash should check the terminal size after every command terminates shopt -s checkwinsize # Don't attempt to tab-complete an empty line shopt -s no_empty_cmd_completion # Local customisations ssource "${HOME}/.bash/interactive_local" # Load bash completion if available ssource "/etc/bash_completion"