You are not logged in.

#1 2018-05-24 21:37:16

jamuelle
Member
Registered: 2015-08-09
Posts: 3

[SOLVED] Misbehaving vim in xterm (started from gnome)

Hi,

I have a strange problem when using xterm with vim in gnome.

When I start xterm from the gnome "launcher" menu, by pressing Super key and start typing "xterm", vim inside this xterm behaves very strange: it seems the contents of the vim screen does not get redrawn as it should. When I open a text file with vim and scroll through the file, the screen does not get updated, so that some of the lines remain there. I.e. it appears as if new text gets written but "old" text does not get cleared away. The same problem appears when resizing the window with the mouse. The screen looks very messed up and the letters appear all over the place, due to the lack of redraw.

Strange thing is: when I start a new xterm from within that misbehaving xterm and run vim, everything seems fine. And I can use vim as expected.

It seems like xterm is inheriting a wrong (environment ?) setting from the gnome application launcher. But why would that faulty setting not get propagated when I start xterm again (from within xterm)??

When I compare the environments from the broken and the working xterm, they seem almost the same, expect XTERM_LOCALE is "C" in the broken terminal and "en_US.utf8" in the working one. (and SHLVL is different, of course). But when I change that XTERM_LOCAL variable in the broken terminal, it still does not work, i.e. nothing changed.

The variable $TERM is xterm

Other editors such as e.g. nano work as expected. Also, when using 'vim -u NONE' the problem does not appear and vim works as expected.

Any ideas??

Last edited by jamuelle (2018-05-25 20:02:24)

Offline

#2 2018-05-24 22:05:19

seth
Member
Registered: 2012-09-03
Posts: 51,319

Re: [SOLVED] Misbehaving vim in xterm (started from gnome)

XTERM_LOCAL is exported to the shell, not the VTE.
Compare

tr '\0' '\n' < /proc/<pid of xterm>/environ  | grep -E '(LC_|LANG)'

and check the output of "localectl"

Offline

#3 2018-05-25 05:41:31

jamuelle
Member
Registered: 2015-08-09
Posts: 3

Re: [SOLVED] Misbehaving vim in xterm (started from gnome)

Thanks for the input!

On the misbehaving xterm, I get:

LC_ALL=C
LANG=C
GDM_LANG=C
LC_COLLATE=C
LANGUAGE=en_US

In the xterm where vim works as expected:

LC_ALL=en_US.utf8
LANG=C
GDM_LANG=C
LC_COLLATE=C
LANGUAGE=en_US

And the output of localectl is:

   System Locale: LANG=en_US.UTF-8
                  LANGUAGE=en_US
                  LC_COLLATE=C
       VC Keymap: n/a
      X11 Layout: n/a

Might that be the source of the problem? Should I set LC_ALL of gnome to "en_US.utf8" ? How would I do that?

Last edited by jamuelle (2018-05-25 05:42:43)

Offline

#4 2018-05-25 06:11:56

jamuelle
Member
Registered: 2015-08-09
Posts: 3

Re: [SOLVED] Misbehaving vim in xterm (started from gnome)

Oh, it turned out my "/etc/locale.conf" file looked like

LANG=en_US.UTF-8
LC_ALL=C

No idea where that came from tongue Removing the LC_ALL line (and leave the LANG=en_US.UTF-8 there) fixed the problem. Thanks so much for your input!

Last edited by jamuelle (2018-05-25 06:46:51)

Offline

Board footer

Powered by FluxBB