Skip to content

Implement terminal shell integration #133084

Closed
@Tyriar

Description

@Tyriar

Shell integration involves injecting sequences into the prompt such that we know additional information about what is happening in the process such as:

  • The start of the prompt
  • The end of the prompt/start of the input
  • The end of the input
  • The current working directory
  • The exit code of last process/command

This additional information enables a lot of possibilities:

  • A more reliable and faster mechanism for detecting the cwd - one that actually works on Windows (at least for pwsh). For Windows this would allow lighting up some functionality that's currently disabled like inheriting the cwd in split terminals or resolving links relative to the cwd.
  • Track command prompts, inputs and their output. This enables things like tracking command history, separating "execution blocks", collapsing past output, block-level actions/context menu, etc.
  • Potentially exposing a run command extension API which runs within an existing shell session and returns the exit code, additional state could also be exposed via Terminal.state.
  • Overall better awareness of what's going on inside the terminal, currently it's mostly a black box and the main ways of detecting things is via scanning all text (eg. tasks) or by listening for certain key presses (eg. current command tracking).
  • If we know reliably when input is being accepted into the shell and what the current input is, we could provide auto-complete of history - this could even be extended to extensions in a similar way that the text area does it. Taking this a step further, monaco could potentially be used which enabled multi-cursor, familiar shortcuts, etc. (that would lose native shell autocomplete though).

Notes:

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalityon-release-notesIssue/pull request mentioned in release noteson-testplanterminalGeneral terminal issues that don't fall under another label

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions