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