Change default shell from bash to zsh by default?

setup-dist is no longer auto started with zsh. This is important for Whonix CLI.

For bash this is implemented in:

How could we do something similar for zsh?

Probably bad idea to make zsh parse /etc/profile and /etc/profile.d?

Is there an equivalent for /etc/profile.d for zsh?

1 Like

Thanks, merged!

Should the code for parsing /etc/zprofile.d be moved to the very bottom of the script? Why:

  • Allows overwriting the defaults set beforehand.
  • Does not stop execution of defaults in case any scripts residing in /etc/zprofile.d have an issue.

Keeping in mind:

bash /etc/profile.d:

  • Parsed in “CLI” mode, i.e. login, real terminal (tty).
  • Not parsed in terminal emulator / X11.

zsh /etc/zprofile.d:

  • Parsed in “CLI” mode, i.e. login, real terminal (tty).
  • Also parsed in terminal emulator / X11.

For bash, therefore /etc/X11/Xsession.d needed to be used because there’s no /etc/bashrc.d.

1 Like

To run in login shell only so this does not re-run for all terminal emulators tuning in X11 (GUI). Pseudo code:

if ! tty | grep -q /dev/tty ; then
   true "$0: Not running in a login shell, not parsing /etc/zprofile.d folder."
   return
   exit 0
fi

Minor point: Why return and exit? return only works for sourceed. Does not work when executed (for testing purposes).

Now that noexec made a ton of progress…

Can zsh help with the interpreter lock?

Do you think zsh restricted mode is useful for this?

Qubes dom0:

sudo xl console vmname

Looks messed up probably due to colors.

Perhaps based on

echo "$TERM"

vt220

don’t use colors?


feature request: support the no color environment variables

Similar to dist-installer-cli.

  if test -n "${NO_COLOR:-}" || test -n "${ANSI_COLORS_DISABLED:-}"; then

No, rzsh ,rbash or any r shell is too restricted, can’t even cd.

1 Like

Some are related to colors, but I tried removing it and it still looks very bad because of some zsh specific escape sequences that I couldn’t figure out how to disable.

Use bash when using vt220.

1 Like

I’m unhappy with this decision. The shell will always be difficult to use for non-technical people, bash vs zsh makes no difference.

This feels more like a personal preference of the developers, rather than a technically sound decision. Like making $EDITOR something other than nano.

Plain bash is standard in almost every single distribution, I don’t think Whonix should differ. I hope that the change can be undone in a future release.

I would also like to add that the disclaimer in bash should be removed, as it has been in zsh.


A question (and critique depending on answer), is that you can’t change default shell without modifying the template in Qubes-Whonix. This is very bothersome for multiple reasons (needing to clone, risking editing default templates, VM fingerprinting, having to restart, etc).

2 Likes

How can I change my default shell back to bash? This is very unpleasant and I just wasted more time than I’d care to admit troubleshooting an issue that turns out simply to be due to this unexpected change to zsh. Very frustrating.

Documented here: Default Interactive Shell

1 Like

Awesome, thank you! I greatly appreciate your help and the work that you all do.

Out of interest what exactly was the issue with zsh for your use-case?

in current zsh configs that differ from bash if user want to use --purge he cant use it directly but instead he need to put it this way “–purge”

cant this be fixed in zsh? or is there a certain benefit out of this?

1 Like

It would help us fix the issue if you could describe it.

1 Like