terminal
terminal copied to clipboard
VSCode-like Shell Integration
Description of the new feature/enhancement
https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#shell-integration
- shellIntegration
- Command navigation
- run-recent-command
- Go to recent directory
- 👍
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#
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
Also https://github.com/microsoft/terminal/issues/6632
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" 😄
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.
iTerm also has a really cool password manager that integrates with 1Password for example
VS Code has now enabled its shell integration by default in 1.70.
I know it's trivial but I really like the command decoration circles too...
And copy entire command's output!
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
localtasks / suggestions. - 4def21a looks like it did all the actual business
- there's a test file in 0c68bd1778595dba9f42605a8f7347d86825fcc3