Skip to content

Terminal escape sequences printed on startup in tmux #16547

Closed as not planned
Closed as not planned

Description

@justindotdevv

Bug Description

When opening opencode inside a tmux session, terminal escape sequence responses are printed as text instead of being consumed properly.

Environment

  • Terminal: Alacritty (with TERM=xterm-256color)
  • Shell: zsh
  • Terminal multiplexer: tmux (TERM=tmux-256color)
  • Config files:
    • ~/.config/alacritty/alacritty.toml:
      general.import = [ "~/.config/omarchy/current/theme/alacritty.toml" ]
      
      [env]
      TERM = "xterm-256color"
    • ~/.config/tmux/tmux.conf:
      set -g default-terminal "tmux-256color"
      set -ag terminal-overrides ",*:RGB"
      set -g allow-passthrough on
      set -g escape-time 0
      set -g focus-events on
    • ~/.zshrc:
      alias oc='opencode'
      eval "$(starship init zsh)"

Steps to Reproduce

  1. Open alacritty terminal
  2. Start tmux: tmux
  3. Run opencode: opencode (or oc)
  4. Observe the escape sequences printed at the prompt

Expected Behavior

opencode should start normally without printing terminal escape sequences.

Actual Behavior

The following escape sequences are printed:

omarchy master ❯ ?1016;0$y
/2026;2$y_

Additional Context

  • Does NOT occur when running opencode outside of tmux (directly in alacritty)
  • Does NOT occur in tmux when running other interactive terminal applications
  • The sequences appear to be DECRPM (DEC Private Mode Report) responses:
    • ?1016;0$y - Cursor Attribute Report response
    • /2026;2$y - Cursor Shape query response

These sequences suggest opencode is querying terminal cursor capabilities on startup, but the responses are leaking through and being printed as text instead of being consumed properly.

Attempted Fixes

  • Added set -g allow-passthrough on to tmux config (already present)
  • Added set -ag terminal-features 'alacritty:clipboard' to tmux config
  • Neither resolved the issue

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Mar 8, 2026
  2. github-actions commented on Mar 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is already covered by one of those, please close this one and add any additional context there instead.

  3. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions