From 8d9614c918ac5f111fbfc5cd41f66f2785864aca Mon Sep 17 00:00:00 2001 From: thek4n Date: Mon, 14 Oct 2024 16:07:44 +0300 Subject: [PATCH] tmux sessions --- .gitignore | 2 +- home/user/.tmux/{temp => sandbox} | 0 home/user/.tmux/ssh | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-) rename home/user/.tmux/{temp => sandbox} (100%) diff --git a/.gitignore b/.gitignore index 960f10d..4165084 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,5 @@ home/user/.config/tmux/local.conf home/user/.tmux/* !home/user/.tmux/dotfiles -!home/user/.tmux/temp +!home/user/.tmux/sandbox !home/user/.tmux/ssh \ No newline at end of file diff --git a/home/user/.tmux/temp b/home/user/.tmux/sandbox similarity index 100% rename from home/user/.tmux/temp rename to home/user/.tmux/sandbox diff --git a/home/user/.tmux/ssh b/home/user/.tmux/ssh index 2aa3227..b0d98ed 100755 --- a/home/user/.tmux/ssh +++ b/home/user/.tmux/ssh @@ -5,7 +5,11 @@ declare SSH_SERVER read -r SSH_SERVER readonly SSH_SERVER -readonly SESSION="ssh-${SSH_SERVER}" +declare SSH_SERVER_SESSION_NAME +SSH_SERVER_SESSION_NAME="$(echo "$SSH_SERVER" | sed 's/\./_/')" +readonly SSH_SERVER_SESSION_NAME + +readonly SESSION="ssh-${SSH_SERVER_SESSION_NAME}" if ! tmux has-session -t "${SESSION}"; then tmux new-session -s "${SESSION}" -d -n "${MAINW}" -c "${WORKING_PROJECT}" "ssh ${SSH_SERVER}"