From d9a9ce0a86e76184ea6d9b19a1b8d2bef6f33e51 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 18:56:39 -0600 Subject: [PATCH] Allow hw-diags to reattach to the tmux session * The option to kill the current session and start a new was left in place --- .bin/Scripts/hw-diags | 9 ++++++--- .linux_items/packages/live_add | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.bin/Scripts/hw-diags b/.bin/Scripts/hw-diags index e8d838df..d3a1cb21 100755 --- a/.bin/Scripts/hw-diags +++ b/.bin/Scripts/hw-diags @@ -8,7 +8,7 @@ MENU="hw-diags-menu" function ask() { while :; do - read -p "$1 " -r answer + read -p "$1 [Y/N] " -r answer if echo "$answer" | egrep -iq '^(y|yes|sure)$'; then return 0 elif echo "$answer" | egrep -iq '^(n|no|nope)$'; then @@ -26,7 +26,10 @@ die () { if tmux list-session | grep -q "$SESSION_NAME"; then echo "WARNING: tmux session $SESSION_NAME already exists." echo "" - if ask "Kill current session?"; then + if ask "Connect to current session?"; then + # Do nothing, the command below will attach/connect + echo "" + elif ask "Kill current session and start new session?"; then tmux kill-session -t "$SESSION_NAME" || \ die "Failed to kill session: $SESSION_NAME" else @@ -39,5 +42,5 @@ if tmux list-session | grep -q "$SESSION_NAME"; then fi # Start session -tmux new-session -s "$SESSION_NAME" -n "$WINDOW_NAME" "$MENU" $* +tmux new-session -A -s "$SESSION_NAME" -n "$WINDOW_NAME" "$MENU" $* diff --git a/.linux_items/packages/live_add b/.linux_items/packages/live_add index a297ca05..ea784699 100644 --- a/.linux_items/packages/live_add +++ b/.linux_items/packages/live_add @@ -76,6 +76,7 @@ spice-vdagent terminus-font testdisk-wip thunar +tigervnc tint2 tk tmux