Skip to content

Pull Request: Interactive Session Picker & Quality of Life Improvements#2

Open
Alexintosh wants to merge 4 commits intokolarski:masterfrom
Alexintosh:master
Open

Pull Request: Interactive Session Picker & Quality of Life Improvements#2
Alexintosh wants to merge 4 commits intokolarski:masterfrom
Alexintosh:master

Conversation

@Alexintosh
Copy link

Summary

This PR introduces an interactive session picker that appears after detaching from a screen session, along with several quality-of-life improvements that enhance the user experience.

Motivation

The current workflow requires users to manually run s after detaching to see available sessions and then run another command to attach. This creates friction in the most common use case: switching between multiple sessions.

With this change, when a user detaches (Ctrl+A-D), they're immediately presented with an interactive picker to:

  • Quickly attach to another session
  • Create a new session
  • Or exit cleanly

This reduces the session-switching workflow from 3 steps to 1.

Changes

1. Interactive Session Picker (Main Feature)

After detaching from any screen session, an interactive picker automatically appears:

Select a session:
> ✨ Create new session...
  πŸ“Ί my-project (detached)
  πŸ“Ί backend (attached)
  πŸ‘‹ Quit
  • Uses arrow keys for navigation
  • Shows session status (attached/detached)
  • Loops until user selects "Quit"
  • Respects --emoticons flag
  • Only activates in interactive TTY (safe for scripts)

2. --help / -h Flag

Added proper help output:

s - A simple screen session manager

USAGE:
    s [OPTIONS] [COMMAND] [SESSION]

OPTIONS:
    -h, --help        Show this help message and exit
    -v, --version     Show version information and exit
    -e, --emoticons   Enable emoticon icons in the output
    -K, --kill-all    Kill all screen sessions

COMMANDS:
    s                     List all active screen sessions
    s <name or ID>        Connect to an existing session or create a new one
    s kill <name or ID>   Kill/remove a session

3. --kill-all / -K Flag

Quickly terminate all screen sessions at once:

$ s --kill-all
Killing 3 screen session(s)...
All sessions killed successfully.

4. Bug Fix: screen -ls Exit Code Handling

Fixed an issue where screen -ls returning exit code 1 (which happens when there are detached sessions) was incorrectly treated as an error. Sessions are now properly listed regardless of exit code.

5. Improved Confirm Prompts

Replaced manual stdin reading with dialoguer::Confirm to fix terminal input issues (Enter key showing ^M).

6. Documentation Updates

  • Updated README with new features and examples
  • Added Command-Line Options table
  • Updated quickstart to showcase the picker

7. Install Script Improvements

  • Added ARM64/aarch64 architecture detection for Apple Silicon Macs
  • Improved success messages

Dependencies Added

  • dialoguer = "0.11" - For interactive terminal prompts (Select, Confirm, Input)

This is a well-maintained, minimal crate that handles terminal state properly.

Testing

  • cargo build passes
  • cargo test passes (2 tests)
  • Manual testing of all new features
  • Verified picker only appears in interactive terminals
  • Tested on macOS ARM64

Breaking Changes

None. All existing commands work exactly as before.

Screenshots

Session Picker After Detach

Select a session:
  ✨ Create new session...
> πŸ“Ί my-project πŸ’€
  πŸ“Ί backend πŸ”—
  πŸ‘‹ Quit

Kill All Sessions

$ s -e --kill-all
πŸ—‘οΈ Killing 2 screen session(s)...
βœ… All sessions killed successfully.

Happy to address any feedback or make adjustments!

@kolarski
Copy link
Owner

kolarski commented Jan 29, 2026

Thanks for the PR!

These look like great improvements. I’ll need some time to review and test them before merging.

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.

2 participants