Skip to content

feat(terminal-palette): add tmux OSC sequence passthrough support - #354

Merged
kommander merged 2 commits into
anomalyco:mainfrom
melMass:fix-tmux-osc
Nov 27, 2025
Merged

kommander merged 2 commits into
anomalyco:mainfrom
melMass:fix-tmux-osc

Conversation

@melMass

@melMass melMass commented Nov 27, 2025

Copy link
Copy Markdown
Contributor
  • wrap OSC sequences for tmux using DCS format (ESC P tmux; ...)
  • detect tmux environment and automatically wrap sequences when needed
  • consolidate OSC writes through new writeOsc() method for cleaner passthrough handling

- wrap OSC sequences for tmux using DCS format (ESC P tmux; ...)
- detect tmux environment and automatically wrap sequences when needed
- consolidate OSC writes through new writeOsc() method for cleaner passthrough handling
/**
* Check if running inside tmux
*/
function isTmux(): boolean {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could it use renderer.capabilities here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Instead of checking process.env.TMUX directly in TerminalPalette,
accept isTmux as constructor parameter. Renderer now passes tmux
detection from capabilities or env var.

@kommander kommander left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would like to have this test covered, but it doesn't seem to break existing behaviour according to the tests at least. Can add test coverage afterwards then.

@kommander
kommander merged commit 361ace7 into anomalyco:main Nov 27, 2025
4 checks passed
kommander pushed a commit that referenced this pull request Dec 2, 2025
…pped (#373)

#354 fix was only working for tmux<3.6 because it doesn't have native
OSC4 support, so OSC4 sequence needed escaping.
But, tmux 3.6 has native OSC4 support and wrapping the sequence in a
tmux escape prevent OSC4 to work with tmux 3.6.

This fixes anomalyco/opencode#3688 for tmux 3.6 (regression was introduced by
upgrading to OpenTUI 0.1.51 in
anomalyco/opencode@204a31b.
msmps pushed a commit that referenced this pull request Jan 8, 2026
…pped (#373)

#354 fix was only working for tmux<3.6 because it doesn't have native
OSC4 support, so OSC4 sequence needed escaping.
But, tmux 3.6 has native OSC4 support and wrapping the sequence in a
tmux escape prevent OSC4 to work with tmux 3.6.

This fixes anomalyco/opencode#3688 for tmux 3.6 (regression was introduced by
upgrading to OpenTUI 0.1.51 in
anomalyco/opencode@204a31b.
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