For a couple of months, I’ve had an issue where the screen goes black after I enter my password. After a while, I figured out that pressing Enter solves the problem, and the desktop loads. I searched for a long time for a permanent solution, but neither Google nor AI search found the error.
It turns out it was Keychain that was sending an invisible prompt to press Enter. Not something I even had a clue could be a problem.
It was the Cursor agent CLI that finally solved the bug. Thanks for that. Below is a write-up from Cursor.
Cause
Plasma runs fish as a login shell before the compositor is up. In ~/.config/fish/config.fish there was:
if status is-login
keychain --eval id_ed25519 | source
end
Keychain 3 then waits with the prompt “Press Enter to run ssh-add in this terminal” — invisible on a black VT. That’s why it felt like a hang until you pressed Enter.
Solution
Stop running keychain during DM/session start. Switch to systemd user ssh-agent and load the key afterwards:
- Enable
ssh-agent.socket(user). - Add
SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/ssh-agent.socketto~/.config/environment.d/. - A oneshot
ssh-add-id.servicethat runsssh-addon~/.ssh/id_ed25519(mine had no passphrase). - Remove the keychain block from
config.fish.
The SSH key is still loaded, but no longer blocks the Wayland session.
Short version: do not run interactive prompts in login shells that Plasma starts before the screen exists.