3 # Change konsole tab to current path
4 konsole-rename-path () {
5 if [ "$KONSOLE_DCOP_SESSION" ]
10 if [[ "$SDIR" != "$DIR" ]]
12 SDIR="...${DIR[-25,-1]}"
16 dcop ${KONSOLE_DCOP_SESSION} renameSession "$SDIR"
20 # Change konsole tab to current command
21 konsole-rename-cmd () {
22 if [ "$KONSOLE_DCOP_SESSION" ]
24 # We don't need to change tab to "cd xyz" or precmd redefinition
25 # Yes, this is a dirty hack
26 if [[ "$1" != \ cd\ \"* && "$1" != \ precmd* ]]
30 if [[ "$1" != "$TXT" ]]
36 dcop ${KONSOLE_DCOP_SESSION} renameSession "$TXT"
41 precmd_functions+='konsole-rename-path'
42 preexec_functions+='konsole-rename-cmd'
44 # On changing directory, when in mc (automatically called).