Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows - Changing into directory by omitting cd results in instant crash exit code 0x65 #9871

Open
szymonj99 opened this issue Jul 31, 2023 · 2 comments
Labels
🐛 bug Something isn't working panic platform-specific platform-specific issues windows A Windows specific issue

Comments

@szymonj99
Copy link

szymonj99 commented Jul 31, 2023

Describe the bug

I have a symlinked directory, dir_a. If I call cd dir_a, I get directory not found. If I call ./dir_a, my WezTerm terminal closes.
Same thing happens with Windows Terminal Preview:

❯ ./dir_a
thread 'main' panicked at 'internal error: cannot canonicalize known path: Os { code: 1, kind: Uncategorized, message: "Incorrect function." }', crates\nu-cli\src\repl.rs:507:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

[process exited with code 101 (0x00000065)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

I tried calling the following, and got the following error:

❯ with-env { RUST_BACKTRACE: 1 } { ./dir_a }
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #1:1:1]
 1 │ with-env { RUST_BACKTRACE: 1 } { ./dir_a }
   ·                                  ───┬───
   ·                                     ╰── can't run executable
   ╰────
  help: Access is denied. (os error 5)

Calling the above command but with cd ./dir_a instead results in directory not found.

How to reproduce

  1. Create a symlinked directory.
  2. Call cd symlinked_dir
  3. Get directory not found error
  4. Try calling ./symlinked_dir
  5. Experience crashing terminal

Expected behavior

I expected to change directory to where the symlink points to.

Screenshots

No response

Configuration

key value
version 0.83.1
branch
commit_hash bf5bd3f
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.69.0 (84c898d65 2023-04-16)
rust_channel 1.69.0-x86_64-pc-windows-msvc
cargo_version cargo 1.69.0 (6e9a83356 2023-04-12)
build_time 2023-07-30 18:20:17 +00:00
build_rust_channel release
allocator standard
features default, sqlite, trash, which, zip
installed_plugins

Additional context

I am currently playing around with starship, but the behaviour was consistent before I installed it IIRC.

@szymonj99 szymonj99 added the needs-triage An issue that hasn't had any proper look label Jul 31, 2023
@ChrisDenton
Copy link
Contributor

I suspect this is due to the drive it's being use on. Some drives, such as ImDisk ram disks, do not support canonicalize which is where the "Incorrect function" error comes from. There would need to be a fallback to handle this case.

@fdncred fdncred added 🐛 bug Something isn't working and removed needs-triage An issue that hasn't had any proper look labels Jul 31, 2023
@amtoine amtoine added platform-specific platform-specific issues windows A Windows specific issue labels Jul 31, 2023
@szymonj99
Copy link
Author

I'd say that's spot on. I'm using an ImDisk ram disk as the symlink destination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working panic platform-specific platform-specific issues windows A Windows specific issue
Projects
None yet
Development

No branches or pull requests

5 participants