nushell / nushell/nushell

When opened a non-UTF-8 file, the UTF-8 file cannot be open

Open
#11,062 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:needs-triage
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Describe the bug

Windows. When I open a non-UTF-8 file and an error is thrown, continuing to open a UTF-8 file in the current nu session will also throw an error.

How to reproduce
  1. run open ~\scoop\apps\msys2-cn\current\etc\mtab, this MSYS2 file is a Linux symboliclink
  2. run open ~\scoop\apps\msys2-cn\current\etc\shells
Expected behavior

~\scoop\apps\msys2-cn\current\etc\shells should be print

Screenshots

屏幕截图 2023-11-15 203207
Use nvim Windows port to view the contents of the non-UTF-8 file:
屏幕截图 2023-11-15 203340

Configuration
key value
version 0.86.0
branch
commit_hash 8674ba30b193f544470362dfabf71cbdeb12694c
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.71.1 (eb26296b5 2023-08-03)
rust_channel 1.71.1-x86_64-pc-windows-msvc
cargo_version cargo 1.71.1 (7f1d04c00 2023-07-29)
build_time 2023-10-18 13:18:54 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, extra, sqlite, trash, which, zip
installed_plugins
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the open command and reproduce the two file-opening commands on Windows using the paths in the report. Trace how the failed non-UTF-8 read affects the following UTF-8 read. Done means the second open command prints the contents of shells after the first command fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.