AstragoDE

AstragoDE / ssh-login-setup.sh

Last active 4 days ago

Like 0

AstragoDE revised this gist 4 days ago · 4b57096

1 file changed, 14 insertions, 12 deletions

ssh-login-setup.sh
@@ -1,15 +1,17 @@
1 1 # Launch sequence for interactive SSH sessions only
2 - if [[ $- == *i* ]] && [[ -n "$SSH_TTY" ]]; then
3 -
4 - # 1. Launch Zellij WITHOUT 'exec' so the SSH parent shell stays alive
2 + if [[ $- == *i* ]] && [[ -n "$SSH_TTY" ]]; then
5 3 if [[ -z "$ZELLIJ" ]]; then
6 - zellij
7 - fi
4 + # Set Nushell as the target shell for all Zellij panes/tabs
5 + export SHELL="$(command -v nu)"
6 +
7 + if [[ "$ZELLIJ_AUTO_ATTACH" == "true" ]]; then
8 + zellij attach -c
9 + else
10 + zellij
11 + fi
8 12
9 - # 2. Launch Nushell (either inside Zellij, or when you drop out of it)
10 - if [[ -z "$NU_LAUNCHED" ]]; then
11 - export NU_LAUNCHED=1
12 - exec nu
13 - fi
14 -
15 - fi
13 + if [[ "$ZELLIJ_AUTO_EXIT" == "true" ]]; then
14 + exit
15 + fi
16 + fi
17 + fi

AstragoDE revised this gist 8 months ago · 0e3e37b

1 file changed, 1 insertion

README.md (file created)
@@ -0,0 +1 @@
1 + Add this to the end of your .bashrc to start nushell in zellij after ssh logon.

AstragoDE revised this gist 8 months ago · dd2869b

1 file changed, 15 insertions

ssh-login-setup.sh (file created)
@@ -0,0 +1,15 @@
1 + # Launch sequence for interactive SSH sessions only
2 + if [[ $- == *i* ]] && [[ -n "$SSH_TTY" ]]; then
3 +
4 + # 1. Launch Zellij WITHOUT 'exec' so the SSH parent shell stays alive
5 + if [[ -z "$ZELLIJ" ]]; then
6 + zellij
7 + fi
8 +
9 + # 2. Launch Nushell (either inside Zellij, or when you drop out of it)
10 + if [[ -z "$NU_LAUNCHED" ]]; then
11 + export NU_LAUNCHED=1
12 + exec nu
13 + fi
14 +
15 + fi