Preserve ssh
This commit is contained in:
parent
74152e04fc
commit
e2559a9f85
|
@ -60,7 +60,7 @@ x = 0
|
|||
y = 0
|
||||
|
||||
[[keyboard.bindings]]
|
||||
action = "SpawnNewInstance"
|
||||
command = "clone-terminal"
|
||||
key = "E"
|
||||
mods = "Control|Shift"
|
||||
|
||||
|
@ -636,8 +636,8 @@ semantic_escape_chars = ",│`|:\"' ()[]{}<>"
|
|||
|
||||
[window]
|
||||
decorations = "none"
|
||||
dynamic_title = false
|
||||
opacity = 0.8
|
||||
dynamic_title = true
|
||||
opacity = 0.85
|
||||
|
||||
[window.dimensions]
|
||||
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.
|
||||
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
|
||||
# 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
|
Loading…
Reference in New Issue