]> code.delx.au - dotfiles/blob - .bash/interactive
Removed space in xterm title display
[dotfiles] / .bash / interactive
1 #! bash
2
3 # Sets up the shell for interactive commands
4
5 # Use the terminfo backspace character as the erase character. This is not
6 # enabled by default because terminfo is often broken.
7 #stty erase $(tput kbs)
8
9 # The contents of /etc/debian_chroot will be printed in the prompt. You can
10 # create this file in chroot environments to know where you are.
11 if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then
12 debian_chroot=$(cat /etc/debian_chroot)
13 fi
14
15 # Prompt: user@host:directory$
16 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ '
17
18 # Check for unsupported TERM variable
19 if ! tput init &> /dev/null; then
20 echo "Warning! TERM=$TERM unsupported, using TERM=xterm"
21 export TERM=xterm
22 fi
23
24 # The all important colours!
25 ssource "${HOME}/.bash/colors"
26
27 # xterm titlebar displays 'hostname:workingdir'
28 if tput hs || tput tsl &> /dev/null; then
29 PROMPT_COMMAND='tput tsl; echo -n "$(hostname| cut -d. -f1):${PWD/$HOME/~}"; tput fsl;'
30 fi
31
32 # screen window displays current command
33 case "${TERM}" in
34 screen*)
35 PROMPT_COMMAND="$PROMPT_COMMAND echo -ne '\033k\033\\'"
36 ;;
37 esac
38
39 # Useful aliases
40 alias ls='ls --color=auto'
41 alias ll='ls -hlF'
42 alias la='ls -ha'
43 alias l='ls -halF'
44 alias rm='rm -i'
45 alias less='less -R'
46 alias grep='grep --color=auto'
47
48 # Bash should check the terminal size after every command terminates
49 shopt -s checkwinsize
50 # Don't attempt to tab-complete an empty line
51 shopt -s no_empty_cmd_completion
52
53 # Local customisations
54 ssource "${HOME}/.bash/interactive_local"
55
56 # Load bash completion if available
57 ssource "/etc/bash_completion"
58