When $SHELL variable does not change when I switch shell

Solution 1:

The SHELL variable (along with some other variables, such as HOME and USER) is set by the process that logs you in. It is set to the login shell value set in the passwd database (/etc/passwd). It is not meant to reflect the shell you're currently using.

screen uses the SHELL variable to determine what shell to run inside the screen, so you can override that by running e.g.

SHELL=/bin/bash screen

And if you want bash to be your login shell instead of zsh, you can run the chsh (change shell) command as your user.