Cannot start X with zsh as login shell

After running gentoo for a while I reinstalled FreeBSD. I normally use /usr/local/bin/zsh as my login shell, so that is what I set using chsh.
Now X don't start.
If I chsh back to /bin/sh X will start normally.

runing

zsh -l
echo $?



returns zero.

As i am using XFCE i can configure its terminal to run /usr/local/bin/zsh as its shell, and it works. But i cannot start e.g. emacs in X from that terminal.
Starting X with zsh as login shell used to work recently, so I assume (correct me if I'm wrong) that something has changed.
 
It worked for me with just startx🤔
2025-06-29-154243_1920x1080_scrot.png
 
Nevermind. I turned my computer off, went out and had a walk with my wife, had something to eat, and when I returned it just worked.
 
As is my custom, I spoke to soon. It just worked because I happened to have sh set as login shell.
More testing shows that sh and bash works but zsh don't work as login shells (in that X don't start) when using sddm or ly (starting session from ly, I have not tested the .xinitrc alternative in ly).
It may be something in the latest zsh version. I will test some more before I file a bug report.
 
It may be something in the latest zsh version.
I am already using latest version, see FreshPorts page of shells/zsh for more info.
Code:
freebsd:/usr/home/yusuf
# pkg info -x zsh
zsh-5.9_5
As is my custom, I spoke to soon. It just worked because I happened to have sh set as login shell.
I see.
More testing shows that sh and bash works but zsh don't work as login shells (in that X don't start) when using sddm or ly (starting session from ly, I have not tested the .xinitrc alternative in ly).
Maybe, if you have zsh config, move it out of your way then try starting X with no/clean config. Can you try the ~/.xinitrc method? Display Managers hide reality from the user by design.
 
Yes, my long and complex .zshrc that pulled in plugins and set settings and aliases and have served me well for many years was the culprit. I think I will aim for a simpler .bashrc instead. Thanks for helping me finding root cause!
 
Back
Top