feat(windows): add native commands and PowerShell routing - #3301
Draft
Luca-it15 wants to merge 7 commits into
Draft
feat(windows): add native commands and PowerShell routing#3301Luca-it15 wants to merge 7 commits into
Luca-it15 wants to merge 7 commits into
Conversation
…ng on PATH Plain Windows PowerShell (no Git Bash/WSL, no ripgrep installed) has neither grep nor rg on PATH, so `rtk grep`/`rtk rg` hard-failed instead of running. engine_capture now checks tool_exists(engine.bin()) and, only when the requested binary is absent, walks paths with the already-vendored `ignore` crate and matches lines with the already-vendored `regex` crate. This never substitutes one engine for the other — grep still only falls back when grep itself is missing, same for rg. Output is emitted in the exact file\0line:content shape parse_match_line already expects, so grouping/ truncation/display code is untouched. Context lines (-A/-B/-C) are not supported in fallback mode; only -i/--ignore-case is honored from extra_args. Forward-ports unreleased fork-local work (originally against the pre-refactor grep_cmd.rs) onto develop's search.rs/Engine design. Not tied to a GitHub issue; staged for maintainer discussion before submission.
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.
Summary
developbranchls,tree,wc, and file-basedgrep/rgwhen Unix binaries are unavailablepowershellandpwshwrappers plus safe, case-insensitive routing forGet-Content,Get-ChildItem, andSelect-String(including aliases)-File, and-EncodedCommandby passing them through unchanged/STACKflag-v/--invert-matchin the native search fallback soSelect-String -NotMatchremains correctContext and attribution
This branch deliberately preserves the original commits/authorship from @tienthegainz's #2547 and @sresam89's #2875, then adds the PowerShell/pwsh routing and current-
developintegration work on top.Addresses #1248.
Supersedes #2547.
Includes the fallback work from #2875.
Safety model
Only simple, statically tokenizable cmdlet invocations are routed through RTK. Compound PowerShell syntax and dynamic forms are left to the requested PowerShell executable, avoiding semantic changes to pipelines or scripts.
Validation
cargo fmt --all --checkcargo clippy --all-targets -- -D warningspowershell, nativels,tree,wc, and search fallback)powershell -Command, native listing/count/tree, and search withrgremoved fromPATHGitHub's existing Windows MSVC job provides the authoritative full-suite check for this draft.
AI disclosure
The integration, tests, and PowerShell routing were developed with Codex assistance and manually validated on Windows.