diff --git a/home/user/.local/bin/tmux_attach_session.sh b/home/user/.local/bin/tmux_attach_session.sh index b385f0a..0b274ad 100755 --- a/home/user/.local/bin/tmux_attach_session.sh +++ b/home/user/.local/bin/tmux_attach_session.sh @@ -23,4 +23,4 @@ readonly session_to_attach if [ -n "${session_to_attach}" ]; then tmux switch-client -t "${session_to_attach}" -fi \ No newline at end of file +fi diff --git a/home/user/.local/bin/tmux_start_projects.sh b/home/user/.local/bin/tmux_start_projects.sh index bb237a5..ac75c43 100755 --- a/home/user/.local/bin/tmux_start_projects.sh +++ b/home/user/.local/bin/tmux_start_projects.sh @@ -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 diff --git a/home/user/.tmux/dotfiles b/home/user/.tmux/dotfiles index 2754872..cd57414 100755 --- a/home/user/.tmux/dotfiles +++ b/home/user/.tmux/dotfiles @@ -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 diff --git a/home/user/.tmux/example-background-job b/home/user/.tmux/example-background-job index dd82a3d..f697f04 100644 --- a/home/user/.tmux/example-background-job +++ b/home/user/.tmux/example-background-job @@ -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 @@ -33,4 +33,4 @@ tmux kill-session -t "${SESSION}" EOF chmod +x "${temp_script}" -nohup "${temp_script}" >/dev/null & # run in background \ No newline at end of file +nohup "${temp_script}" >/dev/null & # run in background diff --git a/home/user/.tmux/sandbox b/home/user/.tmux/sandbox index 48d1911..8f62428 100755 --- a/home/user/.tmux/sandbox +++ b/home/user/.tmux/sandbox @@ -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 @@ -21,4 +21,4 @@ WORKING_PROJECT="$(mktemp -td "${SESSION}.XXXX")" readonly WORKING_PROJECT tmux new-session -s "${SESSION}" -d -c "${WORKING_PROJECT}" -tmux switch-client -t "${SESSION}" \ No newline at end of file +tmux switch-client -t "${SESSION}" diff --git a/home/user/.tmux/ssh b/home/user/.tmux/ssh index 45ca3c5..80e0836 100755 --- a/home/user/.tmux/ssh +++ b/home/user/.tmux/ssh @@ -27,8 +27,8 @@ 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 -tmux switch-client -t "${SESSION}" \ No newline at end of file +tmux switch-client -t "${SESSION}"