Linux – How to configure putty to retain the feed from nano on the screen after exiting

linuxnanoputtysshterminal

When I use SecureCRT as my ssh client, and I exit a nano session, the prompt appears under the last state of the nano screen. I've gotten used to being able to refer back to content I was editing, so I like this behavior.

When I use putty, it clears the nano screen content before returning me to the prompt, so the only thing that appears above my new prompt is the terminal content that existed prior to entering nano.

I've searched in putty settings, with no luck so far. Any ideas for how to get the desired behavior when I'm in putty? (or maybe it's a nano or terminal setting, and putty is simply following orders that SecureCRT is not?)

Best Answer

If you go into the Putty Configuration screen, under the "Terminals" category, in the "Features" tab, there is a checkbox for "Disable switching to alternate terminal screen". Make sure to check it, and you'll get exactly the behavior you're looking for.

From the Putty Documentation:

4.6.4 Disabling switching to the alternate screen

Many terminals, including PuTTY, support an ‘alternate screen’. This is the same size as the ordinary terminal screen, but separate. Typically a screen-based program such as a text editor might switch the terminal to the alternate screen before starting up. Then at the end of the run, it switches back to the primary screen, and you see the screen contents just as they were before starting the editor.

Some people prefer this not to happen. If you want your editor to run in the same screen as the rest of your terminal activity, you can disable the alternate screen feature completely.

Source

Related Question