For many years I’ve been using SSH sessions on my PC to talk to headless SBCs such as Raspberry Pi.I HATE monochrome editing and almost as badly hate 16-colour editor.Be wary before going further that 256-colours is not for every situation.
Disclaimer out of the way – with Nano editor and my chosen PC tool Mobaxterm I’ve been stuck in that last-century mode for some time – and Mobaxterm documentation doesn’t help – I’m as good as anyone at finding solutions on Google – but wasted many an hour on this one – until now.Mobaxterm, only when creating or EDITING a session has the option to change the default 16-colour mode (xterm) to 256 colours (xterm-256color).See that EDIT SESSION on the right? Once in there, under BASIC SSH SETTINGS – TERMINAL SETTINGS – there is an option TERMINAL TYPE and XTERM-256COLOR is in there – see below.
With that set, I go onto my SBC SSH session and open MC (Midnight commander) – not MCEDIT.If MC is not installed – apt install mc.In mc-options-appearance – not easy to find with the default colours – you can select 256 colour themes – some are built-in, others can be added.
MODAR-256THIN is my current favourite.From there – when editing a file, use MCEDIT which aside from it’s ropey external copy-paste provides a comfy environment for editing files.See example below… note the rather awful default terminal colours above… Not 100% keen on that black background on spaces next to opening braces above – maybe one of the many alternative themes might be worth investigation.