Commit 4e7d76a
fix(mcp-setup): pause before exit so the terminal stays open
User reported the script "just closes when you run it with the client
still on so I couldn't read the terminal." Confirmed root cause: when
the script is launched into a fresh PowerShell window (double-click,
Run dialog, or any parent process that runs powershell.exe and exits)
the host closes as soon as the script returns — wiping the
"Setup did NOT complete" / "Skipped (still running)" output the
previous commit was specifically meant to surface.
Add a Wait-ForExitKey / wait_for_exit_key call before each summary
exit point in both scripts. The pause:
- Skips when SOURCEBOX_SENTRY_MCP_NO_PAUSE=1 (CI / scripted callers
won't hang waiting for keyboard input)
- Skips when there's no interactive console (PowerShell: not
ConsoleHost or not UserInteractive; bash: no tty and no /dev/tty)
- Otherwise prompts "Press Enter to close..." and reads one line
Only added to the three end-of-script summary exits, not the early
arg-validation / cancel exits — those don't fire after the user has
spent time selecting clients, so a sudden close isn't the same UX
trap.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f7b0b44 commit 4e7d76a
2 files changed
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
348 | 365 | | |
349 | 366 | | |
350 | 367 | | |
| |||
399 | 416 | | |
400 | 417 | | |
401 | 418 | | |
| 419 | + | |
402 | 420 | | |
403 | 421 | | |
404 | 422 | | |
| |||
416 | 434 | | |
417 | 435 | | |
418 | 436 | | |
| 437 | + | |
419 | 438 | | |
420 | 439 | | |
421 | 440 | | |
| |||
429 | 448 | | |
430 | 449 | | |
431 | 450 | | |
| 451 | + | |
432 | 452 | | |
433 | 453 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
338 | 356 | | |
339 | 357 | | |
340 | 358 | | |
| |||
394 | 412 | | |
395 | 413 | | |
396 | 414 | | |
| 415 | + | |
397 | 416 | | |
398 | 417 | | |
399 | 418 | | |
| |||
410 | 429 | | |
411 | 430 | | |
412 | 431 | | |
| 432 | + | |
413 | 433 | | |
414 | 434 | | |
415 | 435 | | |
| |||
422 | 442 | | |
423 | 443 | | |
424 | 444 | | |
| 445 | + | |
425 | 446 | | |
426 | 447 | | |
0 commit comments