Skip to content

TUI cannot scroll up after session completes; exit prints subprocess stack trace #29221

Closed as not planned

Description

@dhruv-anand-aintech

Description

After OpenCode finishes its work in the TUI, I cannot scroll up to review earlier conversation output. Trackpad/keyboard scrolling appears stuck or ineffective once the session is done.

On exit, the process also printed a Python traceback (via my agent-launch wrapper). The traceback may be from interrupt/cleanup during subprocess.wait, but the scroll regression is the primary bug.

OpenCode version

1.15.10

Steps to reproduce

  1. Launch OpenCode (in my case via agent-launch -a opencode)
  2. Run a session that produces multiple messages / tool output
  3. Wait for the agent to finish its work
  4. Try to scroll up to review earlier messages
  5. Exit the session

Expected behavior

  • After the agent completes, I should still be able to scroll up through the full conversation history
  • Exit should be clean (no traceback)

Actual behavior

  • Cannot scroll up to review prior output after work completes
  • On exit, a traceback was printed:
Traceback (most recent call last):
  File "/Users/dhruvanand/.local/bin/agent-launch", line 441, in <module>
    cmd = build_command(args)
  File "/Users/dhruvanand/.local/bin/agent-launch", line 437, in main
    args = parse_args()
  File "/Users/dhruvanand/miniforge3/lib/python3.10/subprocess.py", line 347, in call
    return p.wait(timeout=timeout)
  File "/Users/dhruvanand/miniforge3/lib/python3.10/subprocess.py", line 1209, in wait
    return self._wait(timeout=timeout)
  File "/Users/dhruvanand/miniforge3/lib/python3.10/subprocess.py", line 1959, in _wait
    (pid, sts) = self._try_wait(0)
  File "/Users/dhruvanand/miniforge3/lib/python3.10/subprocess.py", line 1917, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)

Note: agent-launch is a local wrapper that execs opencode in interactive mode by default; the subprocess frames may be from wrapper cleanup rather than OpenCode itself.

Operating System

macOS 26.4 (Darwin 25.4.0, arm64)

Terminal

Cursor integrated terminal (also reproducible behavior class in other terminals per #25931)

Related

Possibly related to #25931 (chat history scroll regression).

Activity

  1. github-actions commented on May 25, 2026

    @github-actions
    Contributor

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

    If this is the same bug, please consider adding a comment to #25931 with any additional details (e.g., the post-completion behavior) rather than keeping a separate issue open.

  2. kommander commented on May 26, 2026

    @kommander
    Contributor

    Can you share the agent-launch source? If you expect the TUI Session to be in the scroll back, that is not how it works. You can use the minimal mode interactively which will write to scrollback with opencode run -i.

  3. dhruv-anand-aintech commented on May 26, 2026

    @dhruv-anand-aintech
    Author

    https://github.com/dhruv-anand-aintech/agent-launch

    It's just a wrapper cli that runs the opencode command with some cli flags. The hang happens in opencode tui. Not expecting it in scrollback, but the scrolling functionality of opencode itself gets stuck

  4. kommander commented on May 26, 2026

    @kommander
    Contributor

    The error trace seems Python related and not opencode specific. Questions:

    • Can the issue be reproduced with direct opencode <same-dir> --model <same-model>, no agent-launch?
    • Does PageUp/PageDown work?
    • Can you share tui.json, OPENCODE_TUI_CONFIG, and whether OPENCODE_DISABLE_MOUSE is set?
  5. github-actions commented on Jul 26, 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