mc "Midnight Commander" wrong colors and keys

ehabehab Content Writer
edited March 2023 in Help

Hi

I use mc a lot in terminals, in some shared hosting the display and keys are wrong
it looks like this

down keys gives BBB "not working"
I maybe an env and comparing working and this one does not really help.

any advise how to fix deserves a kiss on the hand.
Thanks for any advises.

ehab

GNU Midnight Commander 4.7.0.2
Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish, mcfs, smbfs
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
Data types: char 8 int 32 long 64 void * 64 off_t 64 ecs_char 8

env

SHELL=/bin/ovh_ssh
HISTTIMEFORMAT=[%F %T] 
PWD=/home/imok
LOGNAME=yoursunny
HOME=/home/somewhere
USERNAME=
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
SSH_CONNECTION=1.2.3.4 57474 5.5.5.5 22
TERM=xterm-256color
USER=FRANKZ
SHLVL=1
BASH_ENV=/home/FALZO/.bashrc
LD_LIBRARY_PATH=/mumbly/lupa/libs:
SSH_CLIENT=1.3.4.6 57474 22
OVH_ENVIRONMENT=development
TMOUT=300
OVH_APP_ENGINE_VERSION=3.8
OVH_APP_ENGINE=wsgi
MAIL=/var/mail/xrout
SSH_TTY=/dev/pts/0
_=/usr/bin/env

Thanked by (1)Falzo
«1

Comments

  • ehabehab Content Writer

    maybe i tag @Not_Oles he is a shell dude. Any suggestions

  • Not_OlesNot_Oles Hosting ProviderContent Writer

    Hi @ehab! Thanks for tagging me. Wow, I wish I could help! I never use mc except when I get dumped into it by certain install scripts. So I am clueless™ about mc. :( But surely someone here at LES will be able to help. Always best wishes!

    Thanked by (1)ehab
  • @ehab said: Thanks for any advises.

    I also use mc a lot, but I haven't seen this kind of issue in a long time

    TERM=xterm-256color

    So you're using xterm -- good

    What does locale show?

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • ehabehab Content Writer

    @angstrom said:
    What does locale show?

    LANG=fr_FR.UTF-8
    LANGUAGE=
    LC_CTYPE="fr_FR.UTF-8"
    LC_NUMERIC="fr_FR.UTF-8"
    LC_TIME="fr_FR.UTF-8"
    LC_COLLATE="fr_FR.UTF-8"
    LC_MONETARY="fr_FR.UTF-8"
    LC_MESSAGES="fr_FR.UTF-8"
    LC_PAPER="fr_FR.UTF-8"
    LC_NAME="fr_FR.UTF-8"
    LC_ADDRESS="fr_FR.UTF-8"
    LC_TELEPHONE="fr_FR.UTF-8"
    LC_MEASUREMENT="fr_FR.UTF-8"
    LC_IDENTIFICATION="fr_FR.UTF-8"
    LC_ALL=
    

    should this be changed to :

    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    
  • @ehab said: should this be changed to :

    No, a UTF-8 locale is good (whether fr or en)

    Are you using (real) xterm or a console?

    Thanked by (1)ehab

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • ehabehab Content Writer
    edited March 2023

    @angstrom said:
    Are you using (real) xterm or a console?

    i am using Terminal "ssh", how to find out?

  • @ehab said:

    @angstrom said:
    Are you using (real) xterm or a console?

    i am using Terminal "ssh", how to find out?

    So you're not using (real) xterm

    Is the system in question running Debian? If so, what does more /etc/default/console-setup show?

    Thanked by (1)ehab

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • ehabehab Content Writer

    $ cat /etc/default/console-setup
    cat: /etc/default/console-setup: Aucun fichier ou dossier de ce type
    

    "No such file or folder"

  • @ehab said:

    $ cat /etc/default/console-setup
    cat: /etc/default/console-setup: Aucun fichier ou dossier de ce type
    

    "No such file or folder"

    Okay, my best guess is that you're not using an appropriate console font for mc

    Does man console-setup give anything?

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • As su -, try dpkg-reconfigure console-setup

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • On my system, the output of more /etc/default/console-setup is:

    # CONFIGURATION FILE FOR SETUPCON
    
    # Consult the console-setup(5) manual page.
    
    ACTIVE_CONSOLES="/dev/tty[1-6]"
    
    CHARMAP="UTF-8"
    
    CODESET="Lat15"
    FONTFACE="Fixed"
    FONTSIZE="8x16"
    
    VIDEOMODE=
    
    # The following is an example how to use a braille font
    # FONT='lat9w-08.psf.gz brl-8x8.psf'
    

    In the worst case, you could copy this and then log out and in again

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • ehabehab Content Writer

    @angstrom , i don't have sudo rights since its a shared env.
    all i can work with is the .bash* files at ~/
    i will continue tomorrow, need to sleep soon

    thanks a lot for you help , talk soon

    Thanked by (1)angstrom
  • edited March 2023

    @ehab said:
    @angstrom , i don't have sudo rights since its a shared env.
    all i can work with is the .bash* files at ~/
    i will continue tomorrow, need to sleep soon

    thanks a lot for you help , talk soon

    I see

    mc doesn't work with all console fonts, so I strongly suspect that this is the problem

    Here's a suggestion. First, create the file ~/.console-setup. Then copy the following text into this file:

    ACTIVE_CONSOLES="/dev/tty[1-6]"
    CHARMAP="UTF-8"
    CODESET="Lat15"
    FONTFACE="Fixed"
    FONTSIZE="8x16"
    VIDEOMODE=
    

    Then log out and in and see whether this helps

    (Good night)

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • @ehab said: i am using Terminal "ssh",

    So you may not be using a console after all

    Nevertheless, it wouldn't hurt to try what I suggested just above

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • @ehab I see what you did there. Hugs and kisses ♡♡♡

    Same as @angstrom also using mc a lot, but haven't encountered this issue. I think he is already onto it, so I guess you two will get it fixed somehow.

    Thanked by (1)ehab
  • ehabehab Content Writer

    @angstrom said:

    @ehab said: i am using Terminal "ssh",

    So you may not be using a console after all

    Nevertheless, it wouldn't hurt to try what I suggested just above

    the .console-setup. made sense but unfortunately didn't have any effect.
    thanks for your suggestions thou. I will continue.

    have a nice week ahead.

    Thanked by (1)angstrom
  • Try a different Terminal emulator?

    Thanked by (1)ehab
  • @ehab said:

    @angstrom said:

    @ehab said: i am using Terminal "ssh",

    So you may not be using a console after all

    Nevertheless, it wouldn't hurt to try what I suggested just above

    the .console-setup. made sense but unfortunately didn't have any effect.
    thanks for your suggestions thou. I will continue.

    By the way, when you say "Terminal", do you mean the terminal emulator of MacOS?

    I assume that you've checked that mc works on another server but using the same terminal emulator (so that we know that the issue is particular to one server)

    Any chance of using X-forwarding?

    Thanked by (1)ehab

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • edited March 2023

    Another try: on the server, what does more /etc/vconsole.conf show?

    Thanked by (1)ehab

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • edited March 2023

    @ehab said:
    Hi

    I use mc a lot in terminals, in some shared hosting the display and keys are wrong

    If the problem exists on several VPS/servers it is probably in your local settings (on your PC)

    Thanked by (1)ehab

    "From the diamonds nothing is born, from the manure the flowers are born ..."
    F. De Andrè --- Free NAT KVM

  • ehabehab Content Writer

    @angstrom said:
    By the way, when you say "Terminal", do you mean the terminal emulator of MacOS?

    i don't use the mac, but i tried it on macbook and same bad outcome, both colors and keys not good.

    @angstrom said:
    Any chance of using X-forwarding?

    :( no go

    @angstrom said:
    Another try: on the server, what does more /etc/vconsole.conf show?

    file does not exists.

    @carlin0 said:
    If the problem exists on several VPS/servers it is probably in your local settings

    only in 2 shared environments. Otherwise all is good.

  • ehabehab Content Writer

    @flips said: Try a different Terminal emulator?

    YES

    this fixed my problem

    now that deserves a kiss on the hand
    @Ganonk style

    Thanked by (3)Ganonk Amadex flips
  • ehabehab Content Writer

    @angstrom

    i started an alpine docker image and at interactive env

    HOSTNAME=38953153f826
    SHLVL=1
    HOME=/root
    TERM=xterm
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    PWD=/
    

    so i check my current local env
    TERM=xterm-256color

    and changed to
    export TERM=xterm

    vola ... mc is happy

    Thanks to all.... maybe i should put this in the tips.

    high 5 to dear angstrom

    Thanked by (1)angstrom
  • I was just about to ask: what does dpkg-query -l console-setup show?

    But I guess that we can stop now :)

    Thanked by (1)ehab

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • edited March 2023

    @ehab said:
    @angstrom

    i started an alpine docker image and at interactive env

    HOSTNAME=38953153f826
    SHLVL=1
    HOME=/root
    TERM=xterm
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    PWD=/
    

    so i check my current local env
    TERM=xterm-256color

    and changed to
    export TERM=xterm

    vola ... mc is happy

    I'm glad that this works, but needing to use an Alpine docker image for this seems to be (supreme) overkill, if I may say so! :)

    Also, the difference between xterm-256color and xterm shouldn't matter for this -- both should work! I've just tested both, and they both work with mc

    I would still maintain that the original problem is probably a console font issue (but this would be tricky to solve if you don't have admin rights)

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • ehabehab Content Writer
    edited March 2023

    @angstrom said:
    I was just about to ask: what does dpkg-query -l console-setup show?

    But I guess that we can stop now :)

    just to add another tip

    in the .ssh/config this can be added

    Host somename
      HostName yoursunny.mega-center.mekongvps
      user angstrom
      RemoteCommand TERM=xterm $SHELL
      RequestTTY yes
    

    last 2 lines are important

    Thanked by (1)angstrom
  • @ehab said:

    @angstrom said:
    I was just about to ask: what does dpkg-query -l console-setup show?

    But I guess that we can stop now :)

    just to add another tip

    in the .ssh/config this can be added

    Host somename
      HostName yoursunny.mega-center.mekongvps
      user angstrom
      RemoteCommand TERM=xterm $SHELL
      RequestTTY yes
    

    last 2 lines are important

    Glad that this works, but normally, it shouldn't be necessary to have to stipulate this :)

    Thanked by (1)ehab

    "A single swap file or partition may be up to 128 MB in size. [...] [I]f you need 256 MB of swap, you can create two 128-MB swap partitions." (M. Welsh & L. Kaufman, Running Linux, 2e, 1996, p. 49)

  • Thanked by (1)ehab
  • Thanked by (1)ehab

    AmadexHosting ForumsWebshop: Guide to Start Selling Online • Free Debit Card & Online Bank Account 🤑

  • Maybe you installed the politically correct version?

    Thanked by (1)root
Sign In or Register to comment.