Skip to content

Feature: Improved support for standard tmux sessions #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

emiara
Copy link

@emiara emiara commented Mar 2, 2025

Fix issue: #153
Enhances usefulness of the tms command and reduces reliance on standard tmux commands for many.

Existing tmux sessions are included in the fzf of standard commands such as tms switch and the default tms (noargs). This makes a

Implements new enum: SessionType(Standard(PathBuf)). For tmux sessions not created from a git repo or a bookmark.

Instead of create_sessions() for getting sessions from git and bookmarks we now have create_repo_sessions() and additionally create_all_sessions() which includes Standard Tmux sessions in the resulting SessionContainer.

Should this feature be enabled by default (i.e., not configurable), or should it be activated via a flag (e.g. --include-standard-sessions)? If configurable, how should we resolve the conflict with --switch-filter-unknown, which currently applies only to tms switch?

emiara and others added 15 commits February 27, 2025 18:43
- Implemented SessionType::Standard for existing tmux sessions
- Implemented SessionContainer and Session listing functionality for
Tmux struct
- In main: Defined default command behavior (read: "tms") to output both
git repos and existing tmux sessions
- Combines two HashMap<String, Session> into one, with keys being a set
of unique session names
- Tmux.create_sessions now gives all the the sessions from git and all
the sessions from tmux. (Sessions from git should probably be moved to a
different class)
- Introduce create_repo_sessions for repository session handling
- Add find_tmux_sessions for retrieving tmux sessions
- Merge both into create_all_sessions for a clear distribution of
responsibilities
- Moved session tests to seperate file.
- Improved readability and efficiency
- Renamed switch_to_normal_session() to switch_to_standard_session for
consistency
 - Readability
 - Logic
open_session_command now uses create_all_sessions instead of
create_repo_sessions
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