When I run a ncurses-based tool, say nano, in a Linux/OSX SSH session and then close it, the terminal session is back with the history and everything.
But if I start nano in a FreeBSD SSH session and then close it, nano's window doesn't clear up and the terminal history doesn't show up again.
I recall the same experience a long time ago, when working on a text console Linux, but never cared about it.
So, my question is: How can I make FreeBSD's SSH behave like Linux/OSX'es SSH?
Thanks in advance.
P.S. Here are 2 screenshots of what I get on OSX and FreeBSD: https://i.sstatic.net/6B57e.jpg