Skip to content

Shell prompt: Offer to attach / create unset server, window, session, launch within#642

Open
tony wants to merge 1 commit intomasterfrom
tn-shell-prompt
Open

Shell prompt: Offer to attach / create unset server, window, session, launch within#642
tony wants to merge 1 commit intomasterfrom
tn-shell-prompt

Conversation

@tony
Copy link
Copy Markdown
Member

@tony tony commented Nov 7, 2020

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 7, 2020

Codecov Report

❌ Patch coverage is 68.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.80%. Comparing base (7237fe6) to head (49f60b1).

Files with missing lines Patch % Lines
src/tmuxp/cli/shell.py 68.00% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #642      +/-   ##
==========================================
- Coverage   81.96%   81.80%   -0.17%     
==========================================
  Files          28       28              
  Lines        2545     2566      +21     
  Branches      485      490       +5     
==========================================
+ Hits         2086     2099      +13     
- Misses        328      333       +5     
- Partials      131      134       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: Make `tmuxp shell` resilient when the targeted server or session
doesn't exist yet — interactive users can opt in to creating them
instead of being met with an error and having to retry. Non-interactive
contexts (tests, scripts, CI) keep their original raise semantics.
what:
- Add `-y`/`--yes` flag to skip prompts and proceed with creation
- On dead server: prompt (or auto-yes) to start one with new_session
- On missing session: prompt (or auto-yes) to create the session
- Reset current_pane when its session_id no longer matches the resolved
  session, so downstream get_window/get_pane uses the new session
- Gate prompts on sys.stdin.isatty() so non-TTY callers still raise
- Add tests for `--yes` create-on-missing and non-interactive raise

Re-ports PR #642 (originally written against the pre-`src/` layout
in tmuxp/cli.py + tmuxp/util.py) onto current src/tmuxp/cli/shell.py.
Drops the WIP commit's print() debugs and unused --detached flag.
@tony tony force-pushed the tn-shell-prompt branch from 94bd460 to 49f60b1 Compare April 26, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant