From 8566091b85d93ead1f3a94822f1ef1ff215b0df9 Mon Sep 17 00:00:00 2001 From: iceBear67 Date: Sat, 22 Mar 2025 16:06:12 +0800 Subject: [PATCH] tmux workaround --- .dockerignore | 1 + .gitignore | 1 + init.fish | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.dockerignore b/.dockerignore index 88a84e5..7253512 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ build.sh +.idea diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c2d52b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/* diff --git a/init.fish b/init.fish index bc77a6f..ff8a4cf 100644 --- a/init.fish +++ b/init.fish @@ -11,6 +11,10 @@ if ! cat /etc/passwd | grep -E "^user" end function resume + if test $(sudo -u user tmux list-windows | wc -l) -eq 0 + sudo -u user tmux + return + end if sudo -u user tmux has-session -t 0 if sudo -u user tmux ls | grep -E "^0.*attached)" echo "The default tmux session has been attached, dropping you to a normal shell."