mc, xterm-clear, Ctrl-O and Home/End dilemma

Eugene M. Zheganin emz at norma.perm.ru
Fri Dec 22 06:22:52 UTC 2017


Hi,

On 21.12.2017 23:20, Eugene M. Zheganin wrote:
> Hi,
>
> So, there's a puzzle of minor issues and I wanted to ask how you guys 
> deal with it.
>
> - with standard ncurses misc/mc there's no borders in mc in putty, and 
> Ctrl-O flushes the output beneath panels.
>
> -with slang misc/mc Ctrl-O flushes the output beneath panels (and I 
> lived with this through years, but then discovered xterm-clear).
>
> - with slang and xterm-clear Home/End doesn't work in putty. 
> everything else is fine, but this hurts.
>
> I use my FreeBSD desktop at work and from home wvia putty, so I really 
> want to solve this without learning keays each time (and it seems like 
> they aren't save on "Save setup".
>
> Ideas ?
>
>
So, I figured it out, thanks to https://midnight-commander.org/ticket/2633

two things should be done on each FreeBSD mc is ran on to not ruin other 
ssh sessions:

- a wrapper that will reside in PATH earlier than mc binary:


#!/bin/sh

#
# simple knob to fix mc Ctrl-O without ruining remote Linux sshs
#

if [ $TERM = "xterm" ]; then {
     TERM=xterm-clear
} fi
/usr/local/bin/mc $*


- a fix to /usr/local/share/mc/mc.lib:


[terminal:xterm-clear]
copy=xterm


Then everything works, remote ssh sessions are not affected (like 
Linuxes/other OSes that don't have xterm-clear), putty works fine, 
Home/End working fine.


Eugene.



More information about the freebsd-stable mailing list