Skip to content

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

Open
tony wants to merge 1 commit into
masterfrom
tn-shell-prompt
Open

Shell prompt: Offer to attach / create unset server, window, session, launch within#642
tony wants to merge 1 commit into
masterfrom
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.82%. Comparing base (6edda37) to head (7acfb1d).

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.98%   81.82%   -0.17%     
==========================================
  Files          28       28              
  Lines        2548     2569      +21     
  Branches      485      490       +5     
==========================================
+ Hits         2089     2102      +13     
- Misses        328      333       +5     
- Partials      131      134       +3     

☔ View full report in Codecov by Harness.
📢 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.

@tony tony force-pushed the tn-shell-prompt branch from 5188548 to 1f63506 Compare January 7, 2021 13:06
@tony tony force-pushed the master branch 2 times, most recently from 0f75f46 to 2f4a907 Compare March 9, 2022 12:29
@tony tony force-pushed the master branch 2 times, most recently from b0e744e to 5323c18 Compare March 20, 2022 15:48
@tony tony force-pushed the master branch 2 times, most recently from 1298511 to be197a9 Compare July 16, 2022 15:58
@tony tony force-pushed the master branch 2 times, most recently from 1989584 to b30a864 Compare May 27, 2023 16:53
tony added a commit that referenced this pull request Apr 26, 2026
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
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 49f60b1 to 7acfb1d Compare June 6, 2026 12:51
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