Skip to content

feat(tool): add interactive terminal tool with vscode auto-attach - #41258

Closed
Albertban wants to merge 3 commits into
anomalyco:devfrom
Albertban:terminal-tool
Closed

feat(tool): add interactive terminal tool with vscode auto-attach#41258
Albertban wants to merge 3 commits into
anomalyco:devfrom
Albertban:terminal-tool

Conversation

@Albertban

@AlbertbanAlbertban commented Aug 8, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • New feature

What does this PR do?

Adds a terminal tool to opencode so the agent can open and drive a real interactive PTY (open/read/input/close), and adds VS Code extension support that auto-attaches those sessions into real VS Code terminals via a Pseudoterminal bridge.

Differs from the existing open PR #23794 on the same area by:

  • Auto-attaching agent-created PTYs into VS Code terminals (watcher + "Attach Interactive Terminal" command + port discovery), so you can type passwords interactively instead of the non-TTY bash tool.
  • Running the command through an explicit shell (powershell / cmd / bash, defaulting to PowerShell on Windows).
  • Normalizing input line endings on Windows (\n -> \r) — before this, model-sent \n got stuck in PowerShell's continuation prompt and keystrokes appeared lost.
  • Bundling the real extension icons (previous files were placeholder path references).

How did you verify your code works?

  • bun typecheck passes in packages/opencode; tsc --noEmit passes in sdks/vscode.
  • Verified create/read/input/close roundtrip against a live server, and that auto-attach pops the terminal in VS Code and echoes input both ways.

Screenshots / recordings

N/A (no UI change beyond the auto-attached terminal).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 8, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate found:

This appears to be a closely related PR addressing similar functionality for interactive terminal tooling with PTY sessions. You may want to review whether #23794 is already merged, closed, or if it overlaps with the current PR #41258.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 8, 2026
Sign up for freeto 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.

1 participant

@Albertban