Skip to content

fix(shawnhammer): Refuse to run inside an existing tmux session (#78)#970

Open
ruck314 wants to merge 1 commit into
mainfrom
issues-78
Open

fix(shawnhammer): Refuse to run inside an existing tmux session (#78)#970
ruck314 wants to merge 1 commit into
mainfrom
issues-78

Conversation

@ruck314
Copy link
Copy Markdown
Contributor

@ruck314 ruck314 commented May 1, 2026

Summary

  • Closes shawnhammer should refuse to run if it's accidentally run inside of a tmux session #78. shawnhammer manages its own tmux session via tmux kill-session / tmux new-session. When the script is launched from inside that (or any) tmux session, the surrounding shell gets torn down and the script silently dies with no obvious error.
  • Adds a $TMUX guard at the very top of scratch/shawn/scripts/shawnhammer.sh that bails with a clear error before any side effects.

Test plan

  • bash -n scratch/shawn/scripts/shawnhammer.sh — syntax OK
  • With TMUX set: prints ERROR: shawnhammer cannot be run from inside a tmux session. and exits 1 (no tmux session is killed)
  • With TMUX unset: guard is skipped; script proceeds to the existing arg/cfg validation (no false positive)
  • Smoke-test on a real SMuRF server: tmux new -s test78 then run shawnhammer — confirm it refuses; detach and re-run from a normal shell — confirm normal startup is unchanged.

Note on PR #967

PR #967 renames this file to scripts/smurf_startup.sh. Whichever lands second is a trivial rebase to move the same 10-line guard into the renamed file.

shawnhammer manages its own tmux session via `tmux kill-session` /
`tmux new-session`. If the script is launched from inside that (or any)
tmux session, the surrounding shell is torn down and the script silently
dies with no obvious error. Guard against that up front by checking
$TMUX and bailing with a clear message before any side effects.
@ruck314 ruck314 requested review from swh76 and tristpinsm as code owners May 1, 2026 21:08
@github-actions github-actions Bot added the client Changes to the client code label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Changes to the client code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shawnhammer should refuse to run if it's accidentally run inside of a tmux session

1 participant