pop-os / cosmic-term

WIP COSMIC terminal emulator
GNU General Public License v3.0
367 stars 61 forks source link

Terminal won't respect setted default shell #276

Open hbacelar8 opened 1 month ago

hbacelar8 commented 1 month ago

After changing the default shell to zsh, spawning new instances will sill log into bash.

RossBarnie commented 1 month ago

This works for me, how did you set your shell, does it work in other terminals?

hbacelar8 commented 1 month ago

This works for me, how did you set your shell, does it work in other terminals?

sudo apt install zsh && zsh

After going through the zsh's config wizard, which normally sets zsh as default shell which has worked on other distros before:

chsh -s $(which zsh)

Launching Cosmic Term opens bash wheres launching Wezterm opens Zsh. (Wezterm has a horrible performance on Cosmic DE btw)

zahariaca commented 3 weeks ago

I can confirm, I have experience the above.

Shell was set like @hbacelar8 said, after oh-my-zsh tried to set it when it was installing (and it didn't work as expected).

/etc/passwd also shows that zsh is correctly set for my user.

MoSal commented 3 weeks ago

Shell launched depends on the SHELL environment variable, then the login shell set in the password file. SHELL doesn't update to the latest login shell without a re-login.

wezterm is actually the odd one out here since it unsets SHELL at start-up.

So the fix would be a one-liner if this was a valid bug. But personally, I'd rather users' environments not be touched without a VERY good reason. A user can always explicitly unset SHELL, or set it to whatever shell binary.

# force use updated login shell from password file
unset SHELL; cosmic-term
# use whatever shell you want
SHELL=/path/to/shell/binary cosmic-term
MoSal commented 3 weeks ago

Adding an option to ignore SHELL is also a possibility, I guess. But is it really worth it?

zahariaca commented 3 weeks ago

Now that you mentioned it, I remember that the SHELL isn't updated without a relogin, detail I missed yesterday.

My 2cents is that this is working as intended and I agree with your sentiment of not touching user environment without a good reason.

Thank you!