Allow hw-diags to reattach to the tmux session
* The option to kill the current session and start a new was left in place
This commit is contained in:
parent
deec1746e4
commit
d9a9ce0a86
2 changed files with 7 additions and 3 deletions
|
|
@ -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" $*
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ spice-vdagent
|
|||
terminus-font
|
||||
testdisk-wip
|
||||
thunar
|
||||
tigervnc
|
||||
tint2
|
||||
tk
|
||||
tmux
|
||||
|
|
|
|||
Loading…
Reference in a new issue