Skip to main content

Module ShellIntegration

Expand description

Shell integration injection for the integrated terminal.

When LAND_SHELL_INTEGRATION is not explicitly set to "0", this module finds the appropriate shell integration script (bash, zsh, or fish) in the app resource directory and injects it into the shell’s startup sequence so the workbench receives OSC 633 command-tracking sequences.

§OSC 633 sequence meanings

CodeMeaning
APrompt start
BPrompt end
CCommand start
D;NCommand end (exit N)
P;cwd=Current working directory

§Injection strategy per shell

  • bash: --init-file <script> - replaces .bashrc; script sources the original before setting hooks.
  • zsh: set ZDOTDIR to a temp dir whose .zshrc sources the script then LAND_ORIG_ZDOTDIR/.zshrc; avoids touching --rcs.
  • fish: --init-command 'source <script>'
  • All others: no injection; integration unavailable for that shell.

Structs§

Injection
Describes how a shell integration script should be injected.

Functions§

Compute
Computes the Injection for shell_path, or None if the shell is unsupported or integration is explicitly disabled via LAND_SHELL_INTEGRATION=0.
ScriptPath 🔒
Returns the resource-dir path for a named integration script.
ShellName 🔒
Returns the shell binary name (lowercase) extracted from a full path.