Preserve ssh
This commit is contained in:
parent
74152e04fc
commit
e2559a9f85
|
@ -60,7 +60,7 @@ x = 0
|
||||||
y = 0
|
y = 0
|
||||||
|
|
||||||
[[keyboard.bindings]]
|
[[keyboard.bindings]]
|
||||||
action = "SpawnNewInstance"
|
command = "clone-terminal"
|
||||||
key = "E"
|
key = "E"
|
||||||
mods = "Control|Shift"
|
mods = "Control|Shift"
|
||||||
|
|
||||||
|
@ -636,8 +636,8 @@ semantic_escape_chars = ",│`|:\"' ()[]{}<>"
|
||||||
|
|
||||||
[window]
|
[window]
|
||||||
decorations = "none"
|
decorations = "none"
|
||||||
dynamic_title = false
|
dynamic_title = true
|
||||||
opacity = 0.8
|
opacity = 0.85
|
||||||
|
|
||||||
[window.dimensions]
|
[window.dimensions]
|
||||||
columns = 0
|
columns = 0
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
WINDOW_ID=$(xdotool getactivewindow)
|
||||||
|
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
|
||||||
|
|
||||||
|
if [ -f $HOME/.config/terminalscwd/$WM_NAME.ssh ]; then
|
||||||
|
echo $(cat $HOME/.config/terminalscwd/$WM_NAME.ssh) > ~/toto.txt
|
||||||
|
alacritty -e sh -c "TERMINAL_UUID=$WM_NAME ssh $(cat $HOME/.config/terminalscwd/$WM_NAME.ssh)"
|
||||||
|
fi
|
|
@ -14,6 +14,11 @@
|
||||||
# Uncomment following line if you want to disable autosetting terminal title.
|
# Uncomment following line if you want to disable autosetting terminal title.
|
||||||
DISABLE_AUTO_TITLE="true"
|
DISABLE_AUTO_TITLE="true"
|
||||||
|
|
||||||
|
if [ -z $TERMINAL_UUID ]; then
|
||||||
|
export TERMINAL_UUID=$(uuidgen)
|
||||||
|
fi
|
||||||
|
echo -en "\e]2;$TERMINAL_UUID\a"
|
||||||
|
|
||||||
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
||||||
# COMPLETION_WAITING_DOTS="true"
|
# COMPLETION_WAITING_DOTS="true"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
if [ "$PRESERVE_SSH_CWD" = "true" ]; then
|
||||||
|
mkdir -p $HOME/.config/terminalscwd/
|
||||||
|
cd() {
|
||||||
|
builtin cd $1
|
||||||
|
pwd > $HOME/.config/terminalscwd/$TERMINAL_UUID.pwd
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -f $HOME/.config/terminalscwd/$TERMINAL_UUID.pwd ]; then
|
||||||
|
cd $(cat $HOME/.config/terminalscwd/$TERMINAL_UUID.pwd)
|
||||||
|
else
|
||||||
|
cd
|
||||||
|
fi
|
||||||
|
|
||||||
|
ssh() {
|
||||||
|
echo $1 > $HOME/.config/terminalscwd/$TERMINAL_UUID.ssh
|
||||||
|
/usr/bin/ssh $@
|
||||||
|
rm $HOME/.config/terminalscwd/$TERMINAL_UUID.ssh
|
||||||
|
pwd > $HOME/.config/terminalscwd/$TERMINAL_UUID.pwd
|
||||||
|
}
|
||||||
|
fi
|
1
zshrc
1
zshrc
|
@ -31,6 +31,7 @@ source $DOTFILES/zsh/config.zsh
|
||||||
source $DOTFILES/zsh/path.zsh
|
source $DOTFILES/zsh/path.zsh
|
||||||
source $DOTFILES/zsh/exports.zsh
|
source $DOTFILES/zsh/exports.zsh
|
||||||
source $DOTFILES/zsh/aliases.zsh
|
source $DOTFILES/zsh/aliases.zsh
|
||||||
|
source $DOTFILES/zsh/preserve-cwd-ssh.zsh
|
||||||
|
|
||||||
if [ -f $DOTFILES/zsh/extraconfig.zsh ]; then
|
if [ -f $DOTFILES/zsh/extraconfig.zsh ]; then
|
||||||
source $DOTFILES/zsh/extraconfig.zsh
|
source $DOTFILES/zsh/extraconfig.zsh
|
||||||
|
|
Loading…
Reference in New Issue