Skip to content

fix(tmux): handle \r line endings and missing pane_title in list-panes#2284

Open
MoerAI wants to merge 1 commit intocode-yeongyu:devfrom
MoerAI:fix/tmux-list-panes-parsing
Open

fix(tmux): handle \r line endings and missing pane_title in list-panes#2284
MoerAI wants to merge 1 commit intocode-yeongyu:devfrom
MoerAI:fix/tmux-list-panes-parsing

Conversation

@MoerAI
Copy link
Contributor

@MoerAI MoerAI commented Mar 4, 2026

Summary

  • Strip \r characters from list-panes output to handle Windows-style line endings that caused pane rows to be dropped
  • Relax field count check from 9 to 8 fields so panes with empty/missing pane_title are still parsed correctly
  • This fixes the "first subagent split fails in single-pane session" bug where mainPane resolution failed because all pane rows were dropped by the parser

Root cause: In some environments, tmux list-panes output contains \r\n line endings or empty pane_title values. The parser's split("\n") left trailing \r in field values (corrupting parseInt), and the fields.length < 9 check dropped rows where pane_title was absent.

Fixes #2241


Summary by cubic

Fix tmux list-panes parsing by removing \r characters and handling missing pane_title. This restores main pane detection and prevents the first subagent split from failing in single-pane sessions.

  • Bug Fixes
    • Strip \r from list-panes output to support CRLF line endings.
    • Allow 8 fields and default pane_title to "" so panes aren’t dropped.

Written for commit e1952d3. Summary will update on new commits.

Strip \r characters from list-panes output to handle Windows-style line
endings. Also relax field count check from 9 to 8 to handle cases where
pane_title is empty or missing, which caused the parser to drop pane
rows and fail to determine the main pane in single-pane sessions.

Fixes code-yeongyu#2241
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: The changes correctly handle CRLF line endings and optional pane titles, fixing a bug where valid panes were skipped. Minimal risk as it only improves the robustness of tmux output parsing.

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.

tmux: first subagent split can fail in single-pane session due to list-panes parsing

1 participant