Open
Conversation
5466251 to
e090550
Compare
e090550 to
4f20ba2
Compare
1989584 to
b30a864
Compare
why: ``tmuxp load f1 f2 f3 --append`` previously failed on the second file because each file was loaded against its own config's ``session_name``, and the second file's ``new_session`` would collide with the session the first file just created. Multi-file ``--append`` should land every workspace in a single shared target session. The fix has two parts because the old behavior was wrong on two layers: 1. Pre-resolve the target session name once, before the load loop. ``--new-session-name`` wins; otherwise fall back to the first workspace file's ``session_name`` config key. Apply the resolved name to every iteration's ``new_session_name`` so all loads target the same session. 2. Make ``_dispatch_build`` honor ``append`` even when the target session already exists in detached mode. Previously the ``if detached:`` branch unconditionally called ``builder.build()`` (no append arg), which re-tried session creation and raised ``TmuxSessionExists``. New hoisted check: when ``append=True`` and the named session already exists, build windows directly onto the existing session via ``builder.build(existing, append=True)``, honoring ``detached`` for whether to attach afterwards. what: - src/tmuxp/cli/load.py: pre-resolve append_target_session_name in command_load when args.append and len(workspace_files) > 1; force every loop iteration to use it as new_session_name. - src/tmuxp/cli/load.py: add session_name kwarg to _dispatch_build; hoist an append-to-existing-session branch above the detached/ attached split so detached + append + session-exists is honored. - tests/cli/test_load.py: two functional tests covering (a) ``load f1 f2 --append`` coalescing into f1's session_name, and (b) ``--new-session-name`` overriding the first file's session_name. Re-ports PR #839 (originally a single 2022 WIP commit). Drops the WIP's broken in-loop scoping of original_session_name and its type mismatch between ConfigReader._from_file (returns dict) and new_session_name (str).
4f20ba2 to
72fa331
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #839 +/- ##
==========================================
- Coverage 81.96% 81.76% -0.20%
==========================================
Files 28 28
Lines 2545 2572 +27
Branches 485 493 +8
==========================================
+ Hits 2086 2103 +17
- Misses 328 335 +7
- Partials 131 134 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tmuxp load workspace_1 workspace_2 --appendLoads to the same
session_nameas workspace_1, or uses the-s new_session_nameSomewhat released (not exactly): #674 #837