summaryrefslogblamecommitdiffstats
path: root/bashrc/common/screen.sh
blob: 72bc13d58af2876ccc3cb87398555674c8c07ad7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                                              
                                                   

                                                                       


      
                     
                                                


                                   
# screen shelltitle magic

set_screen_title() {
    # prevent reset_screen_title from calling set_screen_title
    if [[ $BASH_COMMAND != "__make_prompt" ]]; then
       _hostname=$(hostname)
       echo -ne "\ek$(id -un)@${_hostname%%\.*}:${BASH_COMMAND/ *}\e\\"
    fi
}

init_preexec_hack() {
    if [[ "${TERM#screen}" != "${TERM}" ]]; then
	trap set_screen_title DEBUG
    fi
}