Finalize VS Code shell integration sequences in code #157571
Merged
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.
Part of #155639
I'll be writing on a page on the VS Code website that will be the main place for script authors to learn about shell integration in VS Code. Let me know if anyone has feedback, AFAIK the only potentially controversial thing is that we duplicate a bunch of sequences that already exist, the reasoning being:
OSC 633
is primarily meant to be used in scripts shipped with VS Code or VS Code extensions for zero-config shell integration. Implementing on the shell side may also happen when first class VS Code support is desired (check$TERM_PROGRAM
).OSC 633
OSC 633
ones (Shell integration: Prioritize OSC 633 over other protocols #157570) to help identify the ideal sequences when multiple shell integration scripts are runningThe recommendation on the website will be to use
OSC 633
when targeting only VS Code, and the more common sequences if possible when writing general purpose scripts. So for the case of p10k for example, its standard shell integration should work for basic command navigation support as it currently does, for full support sending the command line (OSC 633 ; E ; <CommandLine> ST
) will enable command aware functionality and cwd (OSC 633 ; P ; Cwd=<cwd> ST
) will enable current working directory aware functionality.The main change here was to move to less awful serializing of the command line sequence.
cc @zadjii-msft, @andschwa, @SeeminglyScience, @pfitzseb, @romkatv, @fdncred, @zgracem