I have rdist set up to push out some of my dot files to all the remote machines that I need to ssh into. I also have zsh as my default shell on all of those machines.
When I ssh into a machine and then exit, the screen is cleared. I find this behavior bothersome. My attempt to prevent this behavior was to comment out the /usr/bin/clear line in my .logout file. I then dist'd this updated file out to all the remote machines.
The trouble is, that didn't work. I am unsure about this, but I thought .logout was for csh, but I don't have a .zlogout (or .bash_logout either, for that matter). There's nothing in any of my other dot files (e.g., .zshrc, .zshenv) that seems like it would cause the screen to clear. When I ssh into a remote machine, then exec zsh (in order to get a "fresh" shell session), then the terminal will not clear upon exiting the ssh session. But otherwise, the problem persists - on any machine that I connect to, the screen clears upon exiting.
For what it's worth, I don't appear to have the same problem when I set my default shell on the remote machines to bash. So I assume the problem is with zsh.
I checked the dot files to make sure they got dist'd correctly (they did). Aside from this, I'm running out of ideas... why does my terminal keep getting cleared when exiting ssh?
edit: I found the source of the problem: There is a /etc/zlogout file on many of the remote machines. I don't have sudo privileges on many of these machines and I don't want to globally affect users; is there a way to override the functionality in /etc/zlogout? Simply making a $HOME/.zlogout file doesn't seem to work.
clearan alias to""in my .zlogout file. That way when theclearcommand in/etc/zlogoutis called, nothing happens.~/.zlogoutfile. I'll delete my answer and you can add your own.