Repository navigation
Conversation
RTK now runs fully on native Windows. Investigation showed it was already ~85% there (which/PATHEXT binary resolution, cmd /C shell branch, dirs-based paths, the cross-platform `rtk hook claude` binary). This closes the gaps. - env: split PATH with std::env::split_paths (`;` on Windows) instead of `:` - hook-audit: resolve log path via dirs::data_local_dir() instead of hardcoded $HOME/.local/share + /tmp fallback - telemetry: fall back to std::env::temp_dir() instead of "/tmp" - coreutils: detect Microsoft Coreutils (ls/grep/wc/...) in `rtk verify` and `rtk init -g`, guiding users to `winget install Microsoft.Coreutils` - tests: gate 5 sh-dependent stream tests with cfg(not(windows)) so `cargo test --all` is green on native Windows; add cross-platform unit tests for the PATH split, audit path, and coreutils detection - docs: rewrite README Windows section — native is fully supported (auto-rewrite included); WSL is now optional, not required
|
Looks like rtk still doesn't catch native powershell cmd? For example: |
PowerShell cmdlets (Get-ChildItem, Get-Content, ...), functions, aliases, and cmd.exe builtins (dir, echo) are not standalone executables on PATH — they only exist inside a shell. RTK resolved every command via `which` and spawned it directly with no shell, so these failed with "program not found" (exit 127); `rtk ls` only worked because Coreutils ships a real ls.exe. Add `passthrough_command`: on Windows, when a command does not resolve to a PATH binary, run it through PowerShell (prefers pwsh, falls back to powershell) with -NoProfile instead of failing. Behavior on other platforms is unchanged. Wire it into the three run_fallback passthrough sites. Addresses PR rtk-ai#2355 review feedback that `rtk Get-ChildItem` failed. Verified on Windows 11: clippy --all-targets clean, cargo test --all 2145 passed (incl. 4 new tests); rtk Get-ChildItem / powershell Get-ChildItem / dir all run correctly, rtk --version unaffected. Generated with AI Co-Authored-By: AI <ai@example.com>
Author
|
@IwakuraRein The issues with powershell should be addressed |
Contributor
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
Contributor
|
Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you! |
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.
This pull request significantly improves RTK's native Windows support, especially around UNIX-style command filters, and enhances cross-platform behavior and documentation. The most important changes include updating documentation to clarify full Windows support (no WSL required), introducing detection and user guidance for missing Coreutils tools on Windows, and refactoring platform-specific paths and logic for better portability and testability. Several tests and code paths were updated to ensure robust cross-platform operation.
Windows Support and Documentation:
README.mdto clarify that RTK is fully supported on native Windows (no WSL required), and added guidance to install Microsoft Coreutils for full filter functionality. The documentation now includes improved setup instructions and a feature comparison table across Windows, WSL, and Linux/macOS. [1] [2]Coreutils Tool Detection and User Guidance:
COREUTILS_TOOLSconstant and amissing_coreutilsfunction insrc/core/utils.rsto detect missing UNIX-style tools (likels,grep, etc.) on PATH. On Windows, commands now print a one-line hint to install Microsoft Coreutils if any tools are missing. [1] [2] [3] [4] [5]Cross-Platform Path Handling and Environment Logic:
dirs::data_local_dir,std::env::temp_dir) for log and telemetry file locations, ensuring correct behavior on Windows and other platforms. [1] [2] [3] [4]env_cmd.rsto useenv::split_pathsfor platform-aware handling, and added corresponding unit tests. [1] [2]Testing Improvements:
These changes collectively make RTK's Windows experience first-class, improve user onboarding, and ensure robust cross-platform operation.