Windows shell integration: auto-inject pwsh + cmd, prompt-ready signal#445
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Auto-injected OSC 133 shell integration for the native Windows shells, plus a prompt-ready signal the app layer can react to.
What it does:
-NoExit -Command ". '<ghostty.ps1>'"), no$PROFILEedit. The user's profile still loads first, then the integration wraps the final prompt. Reuses the existingghostty.ps1. Explicit user commands (pwsh -c ...) are left untouched.PROMPTenv var, emitting OSC 133;A / 133;B and OSC 9;9 cwd. Preserves a user-setPROMPT. No C/D marks (cmd has no command hooks).prompt_readyapprt action, dispatched on OSC 133;B (mirrorscommand_finishedon 133;D), surfaced to C# asTerminalControl.PromptReady.shell-integrationconfig now resolves/acceptspowershellandcmd.Notes:
TerminalControl.PromptReadyhas no consumer in this repo yet; it's the hook a downstream UI feature subscribes to..directlaunch form for pwsh is deliberate so the dot-source argument survives Windows command re-parsing; barepwshstill resolves via PATH (CreateProcessW(null, ...)).Testing:
zig build testgreen, including theghostty.haction-enum ABI self-check and newsetupPowerShell/setupCmd/detectShellunit tests.PromptReady+ full test suite (1156 passing); native dll + app compile clean.