Something wrong with my root shell prompt in qtile within Python venv

Hi.
Im running FreeBSD 14-RELEASE-p6, Qtile inside Python venv.
All good apart when i go to root shell it shows me different PS1 which never was modified. Same on laptop.
My PS1 line in root`s .shrc
Code:
PS1="\u@\h:\w \\$ "

but my terminal prompt looks like this:
prompt.png



and my .zsh prompt loks like this:
zshprompt.png


Im using
.xinitrc to start my WM but before i use startx im activating Python virtual environment.
I thought my oh-my-zsh changed my root shell but echo $SHELL showed me /bin/sh so ive changed to /bin/csh and my PS1 looked like it should but when i revert back to /bin/sh - i have same PS1 prompt with all the symbols etc. as i believe they are coloring for prompt.

Ive attached my .shrc from user and root .shrc looks identical apart alias commented out.
How can i diagnose why my root shell in venv looks differently then in non-venv environment.
Thank You.
 
i believe they are coloring for prompt.
Correct. They're ANSI escape codes and should be interpreted as such. But it looks like it's using the wrong syntax. Which script did you use to activate the venv?

sh(1):
Code:
               \[      Start of a sequence of non-printing characters (used,
                       for example, to embed ANSI CSI sequences into the
                       prompt).

For tcsh(1) the format is different:
Code:
               %{string%}
                   Includes string as a literal escape sequence.  It should be
                   used only to change terminal attributes and should not move
                   the cursor location.  This cannot be the last sequence in
                   prompt.

But you probably shouldn't be doing this as root in the first place.
 
Correct. They're ANSI escape codes and should be interpreted as such. But it looks like it's using the wrong syntax. Which script did you use to activate the venv?

sh(1):
Code:
               \[      Start of a sequence of non-printing characters (used,
                       for example, to embed ANSI CSI sequences into the
                       prompt).

For tcsh(1) the format is different:
Code:
               %{string%}
                   Includes string as a literal escape sequence.  It should be
                   used only to change terminal attributes and should not move
                   the cursor location.  This cannot be the last sequence in
                   prompt.

But you probably shouldn't be doing this as root in the first place.
No, i was not doing it as root, but i created venv with sh shell and i was using python -m venv /path/to/new/virtual/environment command but used zsh to run source /path/to/new/venv/bin/activate . Im logging in to system as user ( to zsh shell ) and then activating environment and then startx command.
 
Back
Top