From 5d1d0da059df8ecc58cde84e0c0cf5fc327f21f0 Mon Sep 17 00:00:00 2001 From: M1dgard Date: Sun, 26 Aug 2018 13:33:28 +0200 Subject: [PATCH] [terminal.sh] Terminal's doing stuff with my title --- i3/terminal.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i3/terminal.sh b/i3/terminal.sh index 0747fb3..152e7f4 100755 --- a/i3/terminal.sh +++ b/i3/terminal.sh @@ -2,10 +2,10 @@ # 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 -# directory as the currently focused one, if no command is running. This is -# very hackish, but it works. +# directory as the currently focused one. I modified my oh-my-zsh to always +# also print the directory, even when a command is executing. -if [[ $(xtitle) =~ (^| )(~?)(/.*) ]]; then +if [[ $(xtitle) =~ (in|^.*@.*:)\ (~?)(/.*) ]]; then path="${BASH_REMATCH[3]}" [[ ${BASH_REMATCH[2]} == "~" ]] && path="$HOME$path"