-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add tmux session management subcommands #11
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
Merged
Conversation
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
Add comprehensive tmux session management capabilities to gwq for managing long-running processes with persistence and monitoring. ## Features - `gwq tmux list` - List active tmux sessions with filtering and watch mode - `gwq tmux run` - Create new tmux sessions with custom commands - `gwq tmux attach` - Attach to running sessions with fuzzy finder support - `gwq tmux kill` - Terminate sessions with batch operations support ## Implementation Details - Add tmux package for session lifecycle management - Integrate fuzzy finder for interactive session selection - Support context cancellation for long-running operations - Remove unused code and fields for cleaner implementation - Add JSON/CSV output formats for scripting This enables users to run long-running commands (like dev servers, build processes, or tests) in persistent tmux sessions that survive terminal disconnections. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
a7e7760 to
645d1a3
Compare
- Extract common session finder creation logic - Reduce code duplication between attach and kill commands - Simplify multiple session kill error handling with count-based approach - Create reusable helper methods for session formatting and options - Remove unnecessary error accumulation in favor of simple failure counting This improves code maintainability and reduces complexity while maintaining the same functionality.
The --completed flag for tmux kill command was non-functional since tmux sessions always show as 'running' when they exist. This removes: - --completed flag from tmux kill command - StatusCompleted, StatusFailed, StatusDetached constants - Related filtering functions and switch cases - Documentation references to --completed flag Only StatusRunning remains as it's the only meaningful status for active tmux sessions. This simplifies the codebase and removes confusing non-functional features.
Completely remove Status type and related code since all tmux sessions are inherently 'running' when they exist. This eliminates unnecessary complexity and redundant information. ## Changes - Remove Status type and StatusRunning constant - Remove Status field from Session struct - Remove --filter flag from tmux list command (was non-functional) - Simplify session display - always show ● marker for active sessions - Remove formatSessionStatus, countByStatus, filterRunningSessions functions - Update CSV/JSON output to exclude status column - Simplify confirmation dialogs and preview displays - Update documentation and examples ## Result - Simplified codebase with ~150 lines removed - More accurate representation (existence = running) - No confusing non-functional filter options - Consistent ● markers for all sessions
CLAUDE.md should contain development guidelines, not specific feature implementation details. The tmux feature documentation belongs in README.md and release notes.
Remove bullet markers from session names and display working directory by default 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Features Added
New
gwq tmuxsubcommand groupgwq tmux list- List active tmux sessions--watchflaggwq tmux run- Create new tmux sessionsgwq tmux attach- Attach to running sessionsgwq tmux kill- Terminate sessionsTechnical Implementation
internal/tmuxpackage for session lifecycle managementUse Cases
This feature enables users to:
Test plan
make test- all tests passmake lint- no linting issuesgwq tmux run "sleep 30"creates a sessiongwq tmux listshows the running sessiongwq tmux attachconnects to the sessiongwq tmux killterminates the session🤖 Generated with Claude Code