fix tmux bug with related session names

This commit is contained in:
thek4n 2025-05-23 18:03:10 +03:00
parent c3a1612b0f
commit 537e66cf20
6 changed files with 9 additions and 9 deletions

View File

@ -28,7 +28,7 @@ fi
session="$(basename "${project_dir}" | sed 's/\./_/g')"
if ! tmux has-session -t "${session}" 2>/dev/null; then
if ! tmux has-session -t="${session}" 2>/dev/null; then
tmux new-session -d -n 1 -c "${project_dir}" -s "$(basename "${project_dir}")"
fi

View File

@ -7,7 +7,7 @@ readonly MAINW=1
readonly WORKING_PROJECT="${HOME}/dotfiles"
if ! tmux has-session -t "${SESSION}"; then
if ! tmux has-session -t="${SESSION}"; then
tmux new-session -s "${SESSION}" -d -n "${MAINW}" -c "${WORKING_PROJECT}"
tmux splitw -t "${SESSION}:${MAINW}" -d -b -h -l "${_tmux_other_pane_size}" -c '#{pane_current_path}'
tmux send-keys -t "${SESSION}:${MAINW}.1" "git pull --rebase && git push" Enter

View File

@ -7,7 +7,7 @@ readonly SESSION=example-background-job
readonly MAINW=1
if tmux has-session -t "${SESSION}" 2>/dev/null; then
if tmux has-session -t="${SESSION}" 2>/dev/null; then
tmux kill-session -t "${SESSION}"
fi

View File

@ -10,7 +10,7 @@ random() {
readonly SESSION_PREFIX="sandbox"
SESSION="${SESSION_PREFIX}$(random)"
while tmux has-session -t "${SESSION}" 2>/dev/null
while tmux has-session -t="${SESSION}" 2>/dev/null
do
SESSION="${SESSION_PREFIX}$(random)"
done

View File

@ -27,7 +27,7 @@ fi
SESSION="ssh_$(echo "${choosed_ssh_server%% *}" | sed 's/\./\-/g ; s/\:/\-/g')"
if ! tmux has-session -t "${SESSION}" 2>/dev/null; then
if ! tmux has-session -t="${SESSION}" 2>/dev/null; then
tmux new-session -s "${SESSION}" -d -n "1" "TERM=xterm-256color ssh ${choosed_ssh_server} || read"
fi