Skip to content

path relative-to does not work as expected with case-insensitive paths on case-insensitive filesystems #16205

Closed

Description

@RGBCube

Describe the bug

$ "/etc" | path relative-to "/Etc"

Error: nu::shell::cant_convert

  × Can't convert to prefix not found.
   ╭─[entry #8:1:1]
 1 │ "/etc" | path relative-to "/Etc"
   · ───┬──
   ·    ╰── can't convert string to prefix not found
   ╰────

How to reproduce

  1. Run that above command on MacOS or any case-insensitive filesystem

Expected behavior

An empty string, or for "/etc/a" | path relative-to "/etc", "a"

Configuration

column0 column1
version 0.105.1
major 0
minor 105
patch 1
branch
commit_hash
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.87.0 (17067e9ac 2025-05-09) (built from a source tarball)
cargo_version cargo 1.87.0 (99624be96 2025-05-06)
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator standard
features default, sqlite, trash
installed_plugins

Activity

  1. added
    status:needs-triage
    on Jul 18, 2025
  2. 132ikl commented on Jul 18, 2025

    @132ikl
    Member

    tangentially related, we need to fix this error message, it's horrible

  3. RGBCube commented on Jul 18, 2025

    @RGBCube
    Author

    It's even worse when this is in your config.nu, I've spent a decent amount of time just to figure out that this error was because of my prompt config:

    Error: nu::shell::cant_convert
    
      × Can't convert to prefix not found.
       ╭─[source:1:1]
     1 │ nu
       · ▲
       · ╰── can't convert string to prefix not found
       ╰────
    
  4. added
    A:file-system
    on Jul 19, 2025
  5. added a commit that references this issue on Aug 4, 2025
    9f4c3a1
  6. added this to the v0.107.0 milestone on Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:file-systemstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions