Skip to content

fix(input): handle DA1 responses with extended attributes from modern terminals#2908

Open
kofany wants to merge 2 commits intodankamongmen:masterfrom
kofany:fix/tmux-da1-sixel-response
Open

fix(input): handle DA1 responses with extended attributes from modern terminals#2908
kofany wants to merge 2 commits intodankamongmen:masterfrom
kofany:fix/tmux-da1-sixel-response

Conversation

@kofany
Copy link
Copy Markdown

@kofany kofany commented Dec 16, 2025

Summary

Fixes #2736

tmux 3.4+ with sixel support sends DA1 response CSI ? 1 ; 2 ; 4 c which notcurses couldn't parse, causing applications to hang during initialization.

Solution

Add specific patterns for DA1 responses with extended attributes:

  • [?1;2;\Dc - VT100 with extended attrs (tmux 3.4+ with sixel)
  • [?62;\Dc - VT220 (Ghostty, Kitty)
  • [?63;\Dc - VT320
  • [?64;\Dc - VT420 (iTerm2)
  • [?65;\Dc - VT520 (WezTerm)

Generic patterns like [?\N;\N;\Dc conflicted with XTSMGRAPHICS patterns ([?1;0;\NS) in the automaton FSM, causing build failures. Specific patterns avoid these conflicts while covering all major terminals.

Testing

Tested successfully on:

  • Ghostty
  • iTerm2
  • Kitty
  • Alacritty
  • macOS Terminal.app
  • tmux
  • screen

All terminals now initialize correctly without hanging.

tmux 3.4+ with sixel support responds to DA1 query with CSI ? 1 ; 2 ; 4 c
where the '4' indicates sixel capability. The existing parser only handled
responses with up to 2 parameters, causing a hang when encountering 3+.

Added two patterns to handle this:
- Explicit pattern for tmux's specific response: [?1;2;4c
- General pattern for DA1 with 3+ params: [?\N;\N;\Dc
… terminals

Fixes dankamongmen#2736

Problem: tmux 3.4+ with sixel support sends DA1 response CSI ? 1 ; 2 ; 4 c
which notcurses couldn't parse, causing applications to hang during init.

Solution: Add specific patterns for DA1 responses with extended attributes.
Generic patterns like [?\N;\N;\Dc conflicted with XTSMGRAPHICS patterns
in the automaton, so specific patterns are used instead.

Added patterns:
- [?1;2;\Dc - VT100 with extended attrs (tmux 3.4+ with sixel)
- [?62;\Dc  - VT220 (Ghostty, Kitty)
- [?63;\Dc  - VT320
- [?64;\Dc  - VT420 (iTerm2)
- [?65;\Dc  - VT520 (WezTerm)

Tested on: Ghostty, iTerm2, Kitty, Alacritty, Terminal.app, tmux, screen
@j4james
Copy link
Copy Markdown

j4james commented Dec 18, 2025

By dropping the \\N wildcard and then only adding entries for 62 through 65, aren't you missing out on a bunch of other potential values for that first parameter?

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.

Notcurses hangs with tmux (if built with sixel support)

2 participants