Skip to content

Setting PS1 after posix shell initialisation breaks directory registering #939

@kalocsaibotond

Description

@kalocsaibotond

Having a shell startup command like

...
eval "$(zoxide init posix --hook prompt)"
...
PS1='[\u@\h \W]\$'
...

for a posix shell will break zoxide's directory registering capability (for zoxide 0.9.6 ). I tried this out for bash 5.2.32(1) and dash 0.5.12_2 . This is not the case for bash initialisation. After eval "$(zoxide init bash)" setting PS1 will not interfere with zoxide.

I surmise, hence the requirement to put zoxide initialisation as the last startup command.

Nevertheless, this is problematic if I want to set zoxide to be a system-wide available tool, since conventionally, I have to initialise zoxide somewhere in /etc .
If a user sets PS1 then that user inadvertently breaks his access to zoxide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions