Skip to content

fix(Windows): Nushell integration#425

Merged
jdx merged 3 commits intojdx:mainfrom
john-trieu-nguyen:nushell-windows-path-single-quote
Apr 20, 2026
Merged

fix(Windows): Nushell integration#425
jdx merged 3 commits intojdx:mainfrom
john-trieu-nguyen:nushell-windows-path-single-quote

Conversation

@john-trieu-nguyen
Copy link
Copy Markdown
Contributor

@john-trieu-nguyen john-trieu-nguyen commented Apr 20, 2026

let exe = opts.exe.display().to_string();
display() on Windows outputs backslashes eg. "C:\Users\john"

Nushell treats backslashes in double-quoted strings as escape characters.

You get this error when running fnox in nushell on Windows:
unrecognized escape after "\" in string

Update opts.exe.display to use
.to_string_lossy().replace('\\', "/");
fixes issue.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 20, 2026

Greptile Summary

This PR fixes a Windows-specific Nushell integration bug where display() produced backslash-separated paths (e.g. C:\Users\john\fnox.exe) that Nushell interpreted as escape sequences inside double-quoted strings. The fix replaces display().to_string() with to_string_lossy().replace('\\', "/"), converting backslashes to forward slashes (which Windows accepts) before the path is embedded in the generated Nushell script.

Confidence Score: 5/5

Safe to merge — the fix is minimal, correct, and addresses the prior review concern about single-quoted strings.

The approach of converting backslashes to forward slashes is robust: Windows accepts forward slashes in all standard path contexts, UNC paths (//server/share) are also valid on Windows, and the exe path remains inside double-quoted Nushell strings so spaces and other characters are still correctly handled. No P1 or P0 issues remain.

No files require special attention.

Important Files Changed

Filename Overview
src/shell/nushell.rs Replaces backslashes with forward slashes in the exe path to fix Nushell double-quoted string escape errors on Windows; no issues found.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["opts.exe PathBuf"] --> B["to_string_lossy()"]
    B --> C["replace backslash with forward-slash"]
    C --> D["exe: C:/Users/john/fnox.exe"]
    D --> E["Embedded in Nushell double-quoted strings"]
    E --> F["No escape errors in Nushell on Windows"]
Loading

Reviews (2): Last reviewed commit: "update path output to not have backslash..." | Re-trigger Greptile

Comment thread src/shell/nushell.rs Outdated
@john-trieu-nguyen john-trieu-nguyen changed the title Fix Nushell integration on Windows fix(Windows): Nushell integration Apr 20, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Nushell shell integration by replacing double quotes with single quotes for the executable path template. While this change likely aims to resolve backslash escaping issues on Windows, feedback indicates it introduces a regression for file paths containing apostrophes, as Nushell single-quoted strings are raw and cannot escape single quotes. It is recommended to normalize the path using forward slashes and revert to double quotes for better compatibility.

Comment thread src/shell/nushell.rs Outdated
@jdx jdx merged commit e2d0434 into jdx:main Apr 20, 2026
15 checks passed
jdx pushed a commit that referenced this pull request Apr 21, 2026
### 🚀 Features

- Powershell integration by [@nbfritch](https://github.com/nbfritch) in
[#421](#421)

### 🐛 Bug Fixes

- **(Windows)** Nushell integration by
[@john-trieu-nguyen](https://github.com/john-trieu-nguyen) in
[#425](#425)
- **(Windows)** Command resolution for executables by
[@john-trieu-nguyen](https://github.com/john-trieu-nguyen) in
[#427](#427)

### 📚 Documentation

- add releases nav and aube lock by [@jdx](https://github.com/jdx) in
[#422](#422)
- include linux native packages in aube lock by
[@jdx](https://github.com/jdx) in
[#423](#423)

### 🔍 Other Changes

- Use published `clap-sort` crate instead of inlined module by
[@jdx](https://github.com/jdx) in
[#409](#409)
- add communique 1.0.1 by [@jdx](https://github.com/jdx) in
[#424](#424)

### 📦️ Dependency Updates

- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#381](#381)
- update taiki-e/upload-rust-binary-action digest to 10c1cf6 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#383](#383)
- update rust crate tokio to v1.51.1 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#384](#384)
- update rust crate indexmap to v2.14.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#385](#385)
- update rust crate rmcp to v1.4.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#389](#389)
- update rust crate strum to 0.28 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#395](#395)
- update rust crate toml_edit to 0.25 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#396](#396)
- update rust crate miniz_oxide to 0.9 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#390](#390)
- update rust crate ratatui to 0.30 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#392](#392)
- update actions/checkout action to v6 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#397](#397)
- update actions/deploy-pages action to v5 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#399](#399)
- update actions/configure-pages action to v6 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#398](#398)
- update actions/setup-node action to v6 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#400](#400)
- update actions/upload-pages-artifact action to v4 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#401](#401)
- update dependency node to v24 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#403](#403)
- update apple-actions/import-codesign-certs action to v6 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#402](#402)
- update nick-fields/retry action to v4 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#406](#406)
- update github artifact actions (major) by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#404](#404)
- update jdx/mise-action action to v4 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#405](#405)
- update rust crate which to v8 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#408](#408)
- update rust crate usage-lib to v3 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#407](#407)
- bump rustcrypto stack (aes-gcm, sha2, hkdf) together by
[@jdx](https://github.com/jdx) in
[#410](#410)
- update rust crate reqwest to 0.13 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#393](#393)
- update rust crate libloading to 0.9 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#388](#388)
- update rust crate keepass to 0.10 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#387](#387)
- update rust crate rand to 0.10 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#391](#391)
- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#411](#411)
- update rust crate google-cloud-secretmanager-v1 to v1.8.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#415](#415)
- update actions/upload-pages-artifact action to v5 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#418](#418)
- update rust crate rmcp to v1.5.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#416](#416)
- update rust crate clap to v4.6.1 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#413](#413)
- update rust crate tokio to v1.52.1 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#417](#417)
- update rust crate keepass to v0.10.6 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#414](#414)
- update taiki-e/upload-rust-binary-action digest to f0d45ae by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#419](#419)
- update rust crate aws-sdk-sts to v1.102.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#420](#420)

### New Contributors

- @john-trieu-nguyen made their first contribution in
[#427](#427)
- @nbfritch made their first contribution in
[#421](#421)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants