Skip to content

Fix tmux session startup and config escape sequences#173

Open
mackermedia wants to merge 2 commits intosmtg-ai:mainfrom
mackermedia:main
Open

Fix tmux session startup and config escape sequences#173
mackermedia wants to merge 2 commits intosmtg-ai:mainfrom
mackermedia:main

Conversation

@mackermedia
Copy link
Copy Markdown

@mackermedia mackermedia commented Jul 11, 2025

Summary

  • Improved tmux session startup error handling with more detailed error messages
  • Added automatic cleanup of ANSI escape sequences in config files to prevent parsing errors

Changes

1. Enhanced tmux session error handling

  • Added program existence check before attempting to create tmux session
  • Improved error messages with more context (session name, program, directory)
  • Better stderr capture and reporting

2. Config file escape sequence cleanup

  • Added cleanEscapeSequences function to remove ANSI escape codes from raw JSON
  • Added cleanProgramPath function to extract clean paths from escape-wrapped strings
  • Auto-saves cleaned config when escape sequences are detected
  • Prevents future parsing errors from terminal color codes in config

Test plan

  • Test tmux session creation with non-existent program
  • Test config loading with escape sequences in JSON
  • Verify cleaned config is saved correctly
  • Run gofmt to ensure code formatting

Context

This PR addresses issues where:

  1. Users would see generic "Failed to start new session" errors without understanding why
  2. Config files could become corrupted with ANSI escape sequences from terminal output

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 11, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

- Add program existence check before creating session
- Improve error messages with session name, program, and directory context
- Capture and display stderr output for better debugging
- Show current tmux sessions on timeout for diagnostics

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mackermedia
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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