2

I have a feeling that I have this bug, however I've just installed new Nano 4.7 from sources

When I open files, a lot of symbols (even non-unicode) as not displayed properly, but displayed as spaces. When I move cursor on them, they appear (usually).

Demo (nano /etc/environment):

enter image description here

# nano --version
GNU nano, version 4.7
(C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
(C) 2014-2019 the contributors to nano
Email: [email protected]    Web: https://nano-editor.org/
Compiled options: --disable-libmagic --enable-utf8

# locale
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=

My OS is CentOS 8. This I see from PuttY and SSH connection, I cannot check how it looks physically since it's a remote server.

vi and cat work correctly in the same terminal/shell.

What I did and what may have caused the issue:

  • Default locale was POSIX and I updated it to en_US.UTF-8 (maybe I did it wrong?). Reason is that with POSIX neither nano nor vi were displaying unicode symbols in the files correctly.
  • Nano 2.9.8 which comes out-of-the-box started to complain like Error in /usr/share/nano/rust.nanorc on line 11: Bad regex that's why I decided to try new Nano

How can I fix my Nano to show files correctly?

1 Answer 1

1

Seems like I got it resolved by setting locales not to en_US.UTF-8 but to ru_RU.UTF-8.

So now my /etc/environment is like:

LANG=en_US.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"

(I still want messages and UI in English)

And the reason for this, I believe, is that this server was initially configured with Russian layout and language and maybe some system files got ru_RU.UTF-8 encoding/locale/whatever it can be... Anyway, now it seems fine

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .