Skip to content

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

@RGBCube

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:file-systemRelated to commands and core nushell behavior around the file systemstatus:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions