[Feat] Allow the agent to send input to a running background terminal (send_to_terminal)

Open
#512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

Start by locating IRunInTerminalTool and RunInTerminalTool.executeCommand(); the issue identifies these entry points and notes that sendCommand() already uses ITerminalViewControl.pasteString(). Trace how background terminals are opened and how get_terminal_output selects a terminal, then determine how input should target the running process. Done means the agent can send abc to a background interactive terminal and receive got: abc.

Written by the indexing model from the issue text.

Description

enhancement

Problem
The copilot agent can start a long-running interactive process with
run_in_terminal (isBackground=true) and read it with get_terminal_output,
but it cannot send further input to that process. Interactive CLIs (debugger
consoles, serial monitors) therefore cannot be driven step by step:
the model has to pre-script all input (stdin pipe + sleeps) and cannot react
to intermediate replies.

Evidence (0.21.0)

  • IRunInTerminalTool only exposes executeCommand, getBackgroundCommandOutput,
    cancelCurrentCommand.
  • RunInTerminalTool.executeCommand() opens a new Copilot-<id> terminal per
    background call; a new foreground call first runs
    closeRunningForegroundTerminal(...).
  • Internally sendCommand() already uses ITerminalViewControl.pasteString().

Repro

  1. Ask the agent to run in background:
    powershell -NoProfile -Command 'while ($true) { $l = Read-Host ''input''; Write-Output (''got: '' + $l) }'
  2. Ask it to send abc to that terminal and show got: abc.

Observed
Eclipse Copilot: the agent can't type into the running terminal. It ends up writing one script that pipes all input with sleeps and only sees the output at the end.
VS Code Copilot: send_to_terminal works, I get got: abc back.

Dominant language
Java
Stars
128
Forks
70
Avg merge
5d 20h
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/copilot-for-eclipse

All issues in microsoft/copilot-for-eclipse

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.