VSCode-like Shell Integration #17873

Open
opened 2026-01-31 05:57:01 +00:00 by claunia · 9 comments
Owner

Originally created by @heartacker on GitHub (Jul 7, 2022).

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
  3. run-recent-command
  4. Go to recent directory
  5. 👍

Maintainer note: I'm hijacking this issue body, for issue tracking purposes

Main elements of shell integration

References

edit 2025-04-15

VsCode impl

Originally created by @heartacker on GitHub (Jul 7, 2022). # 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. 👍 <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> <hr> _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#
Author
Owner
@zadjii-msft commented on GitHub (Jul 7, 2022): I'm tempted to leave this open as a megathread, linking the other things we have planned across the repo: * [ ] #11000 * [ ] #1595 * [ ] #12861 * [ ] #12863 * [ ] #3121
Author
Owner

@WSLUser commented on GitHub (Jul 8, 2022):

Also https://github.com/microsoft/terminal/issues/6632

@WSLUser commented on GitHub (Jul 8, 2022): Also https://github.com/microsoft/terminal/issues/6632
Author
Owner

@zadjii-msft commented on GitHub (Jul 8, 2022):

I actually intentionally omitted #6632 from that list. #6632 is more about an autocomplete menu who's contents are populated based on the words that are currently in the buffer. The rest of these VsCode features are more driven by specific metadata in the prompt to indicate things like the CWD, the command that's run, where the prompt is, etc. One is something exclusively powered by the terminal, the other is powered by a cooperating shell/commandline program.

It's definitely related, but not necessarily "shell integration" 😄

@zadjii-msft commented on GitHub (Jul 8, 2022): I actually intentionally omitted #6632 from that list. #6632 is more about an autocomplete menu who's contents are populated based on the words that are currently in the buffer. The rest of these VsCode features are more driven by specific metadata in the prompt to indicate things like the CWD, the command that's run, where the prompt is, etc. One is something exclusively powered by the terminal, the other is powered by a cooperating shell/commandline program. It's definitely related, but not necessarily "shell integration" 😄
Author
Owner

@WSLUser commented on GitHub (Jul 8, 2022):

Kitty also has shell integration for various shells. But seems to really intermingle with shells in a way that Iterm2 does not. Wezterm is also looking to implement Iterm2 shell integration from what I saw but nothing has come of that yet other than implementing OSC 7 quite awhile ago.

@WSLUser commented on GitHub (Jul 8, 2022): Kitty also has shell integration for various shells. But seems to really intermingle with shells in a way that Iterm2 does not. Wezterm is also looking to implement Iterm2 shell integration from what I saw but nothing has come of that yet other than implementing OSC 7 quite awhile ago.
Author
Owner

@Stanzilla commented on GitHub (Jul 28, 2022):

iTerm also has a really cool password manager that integrates with 1Password for example

@Stanzilla commented on GitHub (Jul 28, 2022): iTerm also has a really cool password manager that integrates with 1Password for example
Author
Owner

@segevfiner commented on GitHub (Aug 5, 2022):

VS Code has now enabled its shell integration by default in 1.70.

@segevfiner commented on GitHub (Aug 5, 2022): VS Code has now enabled its shell integration by default in 1.70.
Author
Owner

@khuongduybui commented on GitHub (Aug 14, 2022):

I know it's trivial but I really like the command decoration circles too...

@khuongduybui commented on GitHub (Aug 14, 2022): I know it's trivial but I really like the command decoration circles too...
Author
Owner

@khuongduybui commented on GitHub (Aug 14, 2022):

And copy entire command's output!

@khuongduybui commented on GitHub (Aug 14, 2022): And copy entire command's output!
Author
Owner

@zadjii-msft commented on GitHub (Feb 16, 2024):

fhl-task-pane-expando-000

in dev/migrie/fhl/tasks-pane


Local tasks .wt.json wt.json actions

Since these notes seem to be no where else:

  • 58f7f0e836 seems to be the last commit for local tasks / suggestions.
  • 4def21a looks like it did all the actual business
  • there's a test file in 0c68bd1778
@zadjii-msft commented on GitHub (Feb 16, 2024): ![fhl-task-pane-expando-000](https://github.com/microsoft/terminal/assets/18356694/513b9cc2-68cd-455f-84b0-e8c9f54e94fd) in `dev/migrie/fhl/tasks-pane` ------------ Local tasks .wt.json wt.json actions Since these notes seem to be no where else: * 58f7f0e8368cb868aa84a5a45c14e05a53f9c1a9 seems to be the last commit for `local` tasks / suggestions. * 4def21a looks like it did all the actual business * there's a test file in 0c68bd1778595dba9f42605a8f7347d86825fcc3
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17873