[terminal.sh] Terminal's doing stuff with my title

This commit is contained in:
M1dgard 2018-08-26 13:33:28 +02:00
parent 2fea2ba9f8
commit 5d1d0da059
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -2,10 +2,10 @@
# If a window with a path in its title is focused, open a terminal with that # If a window with a path in its title is focused, open a terminal with that
# location as working directory. Like this, terminals are opened in the same # location as working directory. Like this, terminals are opened in the same
# directory as the currently focused one, if no command is running. This is # directory as the currently focused one. I modified my oh-my-zsh to always
# very hackish, but it works. # also print the directory, even when a command is executing.
if [[ $(xtitle) =~ (^| )(~?)(/.*) ]]; then if [[ $(xtitle) =~ (in|^.*@.*:)\ (~?)(/.*) ]]; then
path="${BASH_REMATCH[3]}" path="${BASH_REMATCH[3]}"
[[ ${BASH_REMATCH[2]} == "~" ]] && path="$HOME$path" [[ ${BASH_REMATCH[2]} == "~" ]] && path="$HOME$path"