Skip to content

update-shell should support force pre-pending to the PATH #16782

@zanieb

Description

@zanieb

Summary

Currently, we will exit if the directory is on the PATH at all

if Shell::contains_path(&executable_directory) {
writeln!(
printer.stderr(),
"Executable directory {} is already in PATH",
executable_directory.simplified_display().cyan()
)?;
return Ok(ExitStatus::Success);
}

but this does not allow updating the SHELL in the case where the directory is at the end of the path and binaries are shadowed.

Either we should detect that the relevant binary is shadowed and do this automatically, or we should allow some sort of --force option to prepend even if it's present already.

Example

uv python update-shell --force

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions