From b94cc5537ed55426679f0cacc1adb10b16272eac Mon Sep 17 00:00:00 2001 From: yeti Date: Tue, 13 May 2025 16:39:45 +0100 Subject: [PATCH] feat(ssh): add check for non-interactive terminal --- ssh_router.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssh_router.sh b/ssh_router.sh index e0efab7..b2245bf 100755 --- a/ssh_router.sh +++ b/ssh_router.sh @@ -12,6 +12,12 @@ log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >>"$LOG_FILE" } +if [[ ! -t 0 ]]; then + log "❌ No TTY allocated — refusing to run tmux without an interactive terminal" + echo "Error: No TTY. Use 'ssh -t'" >&2 + exit 1 +fi + # log "🧩 IMAGE = '$IMAGE'" # log "🧩 WORKSPACE = '$WORKSPACE'" # log "🧩 PERSON = '$PERSON'"