microsoft / microsoft/terminal

VSCode-like Shell Integration

Open
#13,445 9 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-TerminalControl Area-UserInterface Issue-Scenario Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

# Description of the new feature/enhancement

https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#shell-integration
1. shellIntegration
2. [Command navigation](https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#command-navigation)
3. [run-recent-command ](https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#run-recent-command)
4. [Go to recent directory](https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#go-to-recent-directory)
5. 👍


_Maintainer note: I'm hijacking this issue body, for issue tracking purposes_

### Main elements of shell integration

- [ ] #1595
- [ ] #12861
- [ ] #12863
- [ ] #12860
- [ ] #12859
- [ ] https://github.com/microsoft/terminal/issues/16599
- [ ] #14779
- [ ] Automatic shell integration
- [ ] https://github.com/microsoft/terminal/pull/12948
- [ ] https://github.com/microsoft/terminal/issues/15057
- [ ] Add horizontal seperators between commands (do we really not have this elsewhere?)
- [ ] #14754
- [ ] https://github.com/microsoft/terminal/issues/17493

### Related, indirectly
* #11000
* #3121
* #6632
* #3337
- I'm including this because it creates a highly-visible surface by which the CWD can be exposed.
- Furthermore: Right-click on a region of output -> "Copy all command output"
- Right-click -> "Rerun this command"




### References

* https://github.com/microsoft/vscode/issues/154662
* https://github.com/microsoft/vscode/pull/171648
* https://github.com/microsoft/vscode/commits/main/src/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1

_edit 2025-04-15_

#### VsCode impl

* This is where VsCode actually injects the args:
* https://github.com/microsoft/vscode/blob/3a28d8d2e1044f2fe28f93076df911fd8fc9fd98/src/vs/platform/terminal/node/terminalEnvironment.ts#L114-L149
* looks like it's mostly:
* Is this commandline something we know how to inject our script into? If so, then inject the CLI args and environment vars
* https://github.com/microsoft/vscode/blob/ef6f1349eb824cef6635d9a3083b871a1c5ddbdf/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts#
* https://github.com/microsoft/vscode/blob/ef6f1349eb824cef6635d9a3083b871a1c5ddbdf/src/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1#

Contributor guide

Open the contributing guide

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.

Research direction

The issue is a broad checklist linking terminal issues and VS Code references, including terminalEnvironment.ts, shellIntegrationAddon.ts, and shellIntegration.ps1. Start by reviewing those references and the linked checklist items to identify a narrowly scoped component. Done is not defined for the overall issue; the scope would need to be narrowed before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, shell, vscode
Domain
cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.