toolbox/profile.d
Debarshi Ray 61efad34bc profile.d: Fix the PS1 on Z shell
Currently, on Fedora, a nested instance of Z shell inside a Toolbox
container renders the PS1 like this:
\[\]⬢\[\][\u@\h \W]\$

Notice that Z shell doesn't like that the terminal escape sequences
for the foreground colour are wrapped in '\[' and '\]' [1], and doesn't
understand the special characters like '\u' and '\h'.

This is fixed by making the PS1 specific to the shell. The prompt for
Z shell is based on the default prompt used on Fedora, just like the
one for Bash.

Note that this only affects nested instances of Z shell because of the
way the start-up scripts for Z shell are written on Fedora. Toolbox
invokes top-level shell as a login shell, and for those the PS1 set by
profile.d/toolbox.sh is overwritten by the operating system's default
in /etc/zshrc. See:
https://bugzilla.redhat.com/show_bug.cgi?id=2026749

[1] Commit bc1a816ea3
    https://github.com/debarshiray/toolbox/issues/190

https://github.com/containers/toolbox/pull/936
2021-11-25 19:04:20 +01:00
..
meson.build Show a welcome text on interactive shells running on Silverblue hosts 2019-04-25 15:52:23 +02:00
toolbox.sh profile.d: Fix the PS1 on Z shell 2021-11-25 19:04:20 +01:00