[FEATURE]: Better active/background terminal and bash management #3969

Open
opened 2026-02-16 17:42:08 -05:00 by yindo · 2 comments
Owner

Originally created by @R44VC0RP on GitHub (Dec 29, 2025).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

So currently in OpenCode TUI the way that a terminal can spawn is via a simple spawn() with piped stdio rather than a full PTY.

Some current issues:

  • the default timeout is 2 minutes (this is not optimal for long running processes), the tool sends a SIGTERM to a long running process which would kill it.
  • the maximum output for terminals are 30,000 characters, some processes show a lot of loading characters that can fill up context

What I propose:

As I said in this thread, I think the bash/terminal management should be a suite of tools.

When a terminal process is initiated we can keep the timeout and character limit the same, but when the timeout is reached rather than sending a SIGTERM it will just move that terminal to a background terminal (accessable via some TUI keybind).

Then once a terminal has moved to the background the agent should have some tools like grep and executeCommandInTerminal so that it will not fill up a ton of context that isn't needed.

This would allow the agent to start/manage/modify/delete sessions a whole lot better than what it does currently. I think a POC might be achievable via a plugin but I want to see what others think of this and other points of view.

Originally created by @R44VC0RP on GitHub (Dec 29, 2025). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request So currently in OpenCode TUI the way that a terminal can spawn is via a simple `spawn()` with piped stdio rather than a full PTY. ### Some current issues: - the default timeout is 2 minutes (this is not optimal for long running processes), the tool sends a `SIGTERM` to a long running process which would kill it. - the maximum output for terminals are 30,000 characters, some processes show a lot of loading characters that can fill up context ### What I propose: As I said in [this thread](https://x.com/ryanvogel/status/2005686463623471543), I think the bash/terminal management should be a suite of tools. When a terminal process is initiated we can keep the timeout and character limit the same, but when the timeout is reached rather than sending a `SIGTERM` it will just move that terminal to a background terminal (accessable via some TUI keybind). Then once a terminal has moved to the background the agent should have some tools like `grep` and `executeCommandInTerminal` so that it will not fill up a ton of context that isn't needed. This would allow the agent to start/manage/modify/delete sessions a whole lot better than what it does currently. I think a POC might be achievable via a plugin but I want to see what others think of this and other points of view.
yindo added the discussion label 2026-02-16 17:42:08 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 29, 2025):

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

  • #3950: Configurable command timeout in config.json - directly addresses the timeout limitation mentioned
  • #1970: Background Bash Execution feature request - proposes background terminal management similar to your proposal
  • #5887: True Async/Background Sub-Agent Delegation - discusses async background execution for long-running processes
  • #2985: Bash tool does not show timeout to model - relates to timeout handling and long-running processes

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 29, 2025): This issue might be a duplicate of existing issues. Please check: - #3950: Configurable command timeout in config.json - directly addresses the timeout limitation mentioned - #1970: Background Bash Execution feature request - proposes background terminal management similar to your proposal - #5887: True Async/Background Sub-Agent Delegation - discusses async background execution for long-running processes - #2985: Bash tool does not show timeout to model - relates to timeout handling and long-running processes Feel free to ignore if none of these address your specific case.
Author
Owner

@Techie5879 commented on GitHub (Feb 9, 2026):

Codex now has background terminals with polling and I can indeed confirm that it has been very useful for long running tasks whereazs opencode has to terminate and rerun with a longer timeout (unless I remember to tell it that this is going to be a long running thing)

@Techie5879 commented on GitHub (Feb 9, 2026): Codex now has background terminals with polling and I can indeed confirm that it has been very useful for long running tasks whereazs opencode has to terminate and rerun with a longer timeout (unless I remember to tell it that this is going to be a long running thing)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3969