Skip to content

shpool blocks changes to PS1 (breaks venv prompt) #312

@GMNGeoffrey

Description

@GMNGeoffrey

What happened
Activating a python venv while running under shpool, the venv prompt update didn't alter the prompt. The issue can be reduced to just setting PS1 in any way.

What I expected to happen
When the user updates PS1, shpool should respect that update. I think my ideal behavior would be a prompt like [session] (venv) user@host: ~ $ (I have prompt_prefix = "[$SHPOOL_SESSION_NAME] " in my config), but that gets a bit weird because venv would naturally prepend to the prompt. The expected behavior would be to respect whatever the user sets PS1 to, so it would end up like (venv) [session] user@host: ~ $, or with default configuration (venv) shpool:session user@host: ~ $

To Reproduce

shpool activate main
export PS1='(my-venv) '"${PS1:-}"; echo $PS1

Output looks like this:

shpool:main <user>@<host>: ~ $ export PS1='(my-venv) '"${PS1:-}"; echo $PS1
(my-venv) shpool:main \[\]\u\[\]@\[\]\h: \[\]\w \[\]$
shpool:main <user>@<host>: ~ $ echo $PS1
shpool:main \[\]\u\[\]@\[\]\h: \[\]\w \[\]$

note that the echo'ed PS1 in the same command its set doesn't match the prompt you get or PS1 after the command has completed. Presumably shpool is completely overriding PS1 as part of its prompt command, drawing from whatever PS1 was when it was launched. I will try constructing the prompt myself following the wiki entry, but I think the default behavior could be better here.

Version info
shpool 0.9.4

Logs
I don't get any journalctl logs for the service for some reason, even though systemctl says the it's running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions