{{ message }}
Repository navigation
feat - improve terminal command execution across windows and linux - #247
Merged
Merged
Conversation
xinyi-gong
marked this pull request as ready for review
May 21, 2026 07:50
xinyi-gong
requested review from
Zidong Lu (duzitong),
Ethan Hou (ethanyhou) and
Sheng Chen (jdneo)
as code owners
May 21, 2026 07:50
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the terminal tool implementation used by GitHub Copilot for Eclipse by making command execution more shell-aware (PowerShell/Bash), improving completion detection via OSC markers, and adding safety/quality features like cancellation and output truncation.
Changes:
- Switch Windows to
powershell.exeand Linux to/bin/bash, adding corresponding shell-integration scripts that emit Copilot OSC prompt/command-finish markers. - Move completion detection to a marker-based approach when integration is available, add Ctrl+C interruption when starting a new foreground command, and cancel running commands when the chat request is cancelled.
- Normalize/format command input (including bracketed paste for multiline) and truncate/clean terminal output before returning it to the model.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
Comments suppressed due to low confidence (2)
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/tools/RunInTerminalToolAdapter.java:84
- These text-block description lines exceed the 120-character Checkstyle LineLength limit. Please wrap/split the long sentences in this Linux tool description section to keep each physical line <= 120 chars.
Command Execution:
- Use && to chain commands on one line
- Never create a sub-shell (e.g., bash -c "command") unless explicitly asked
- Prefer pipelines | for data flow
- Multi-line commands must be complete and non-interactive. Do not run REPLs, continuation-prompt commands, \
unmatched quotes or brackets, or commands that wait for stdin. For Python/Node scripts, create a file first,
then run it
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/tools/RunInTerminalToolAdapter.java:107
- These macOS/Unix text-block description lines appear to exceed the 120-character Checkstyle LineLength limit. Please wrap/split the long sentences so Checkstyle passes.
Command Execution:
- Use && to chain commands on one line
- Never create a sub-shell (e.g., bash -c "command") unless explicitly asked
- Prefer pipelines | for data flow
- Multi-line commands must be complete and non-interactive. Do not run REPLs, continuation-prompt commands, \
unmatched quotes or brackets, or commands that wait for stdin. For Python/Node scripts, create a file first,
then run it
20 of 23 tasks
Member
27 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR updates the Copilot terminal tool to use shell-aware command execution and marker-based completion across Windows and Linux.
Behavior changes
- prompt start
- prompt end
- command completion with exit code