]> code.delx.au - dotfiles/blob - .bash/interactive
More backspace fixes
[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
6 stty erase $(tput kbs)
7
8 # Prompt: user@host:directory$
9 PS1='\u@\h:\w\$ '
10
11 # The all important colours!
12 ssource "${HOME}/.bash/colors"
13
14 # xterm titlebar displays current command
15 case "${TERM}" in
16 xterm*|rxvt*)
17 HOSTNAME="$(hostname | cut -d '.' -f 1)"
18 CWD_WITHHOME='"$(echo "${PWD}" | sed "s|^${HOME}|~|")"'
19 PROMPT_COMMAND="echo -ne \"\033]0;${HOSTNAME}: ${CWD_WITHHOME}\007\""
20 unset HOSTNAME
21 ;;
22 screen*)
23 PS1="\[\033k\033\\\\\]${PS1}"
24 ;;
25 *)
26 ;;
27 esac
28
29 # Useful aliases
30 alias ls='ls --color=auto'
31 alias ll='ls -hlF'
32 alias la='ls -ha'
33 alias l='ls -halF'
34 alias rm='rm -i'
35 alias less='less -R'
36
37 # Bash should check the terminal size after every command terminates
38 shopt -s checkwinsize
39
40 # Local customisations
41 ssource "${HOME}/.bash/interactive_local"
42