When sshing to a host, the screen is cleared at exit, which makes it impossible to review recent output. This behavior seems to be set system-wide in /etc/zlogout. How can zsh be configured to not clear the screen at logout?

Related question: How to prevent clearing of terminal output when I "exit" an SSH session?


The system-wide /etc/zlogout file can be overridden by adding the following to .zlogout:

setopt norcs

The norcs option signifies that zsh should not read any subsequent rc files, which includes /etc/zlogout. And since /etc/zlogout is the last processed rc file, the norcs option does not have any side effect when specified in .zlogout.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.