From 62212e6b83ef6029f8dc2e11d650a2412a1e23d7 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 21 Jun 2024 18:06:29 +0200 Subject: [PATCH] Better --- alacritty.toml | 2 +- bin/clone-terminal | 2 ++ zsh/preserve-cwd-ssh.zsh | 8 +++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/alacritty.toml b/alacritty.toml index 4578cc5..21c1d89 100644 --- a/alacritty.toml +++ b/alacritty.toml @@ -636,7 +636,7 @@ semantic_escape_chars = ",│`|:\"' ()[]{}<>" [window] decorations = "none" -dynamic_title = true +dynamic_title = false opacity = 0.85 [window.dimensions] diff --git a/bin/clone-terminal b/bin/clone-terminal index 6dc9b62..f2cd5aa 100755 --- a/bin/clone-terminal +++ b/bin/clone-terminal @@ -5,4 +5,6 @@ WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2) if [ -f $HOME/.config/terminalscwd/$WM_NAME.ssh ]; then alacritty -e sh -c "PARENT_TERMINAL=$WM_NAME ssh $(cat $HOME/.config/terminalscwd/$WM_NAME.ssh)" +else + alacritty -e sh -c "PARENT_TERMINAL=$WM_NAME exec $SHELL" fi diff --git a/zsh/preserve-cwd-ssh.zsh b/zsh/preserve-cwd-ssh.zsh index d3012bf..d8cd39f 100644 --- a/zsh/preserve-cwd-ssh.zsh +++ b/zsh/preserve-cwd-ssh.zsh @@ -1,9 +1,7 @@ if [ "$PRESERVE_SSH_CWD" = "true" ]; then - if [ -z $TERMINAL_UUID ]; then - export TERMINAL_UUID=$(uuidgen) - fi - echo -en "\e]2;$TERMINAL_UUID\a" - + WINDOW_ID=$(xdotool getactivewindow) + WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2) + export TERMINAL_UUID=$WM_NAME mkdir -p $HOME/.config/terminalscwd/ cd() { builtin cd $1