From 58014ecd9cd856cc96c8392ac15f0f752f4b9307 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Fri, 12 Jun 2020 23:08:09 +0200 Subject: [PATCH] bin: introduce tmux-reattach helper Signed-off-by: Alejandro Mery --- files/bin/tmux-reattach | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 files/bin/tmux-reattach diff --git a/files/bin/tmux-reattach b/files/bin/tmux-reattach new file mode 100755 index 0000000..684f856 --- /dev/null +++ b/files/bin/tmux-reattach @@ -0,0 +1,9 @@ +#!/bin/sh + +if ! which tmux > /dev/null; then + exec screen -dRU +elif tmux list-sessions 2> /dev/null >&2; then + exec tmux attach +else + exec tmux new +fi