I have this really weird problem with X terminal emulators. I want to use UTF-8 and it works everywhere else in my system, but not in graphical terminals. When I start e.g. Urxvt and press öäå-keys it doesn't render anything. If I start a new Urxvt terminal inside the parent terminal everything works fine. Everything works also in tty (Crtl + Alt + F1).

We are using likewise-open to connect domain. I don't know, but can that cause some problems with locales?

What I have done before asking?

  • Trying different terminals (Urxvt and xterm), none is working
  • Trying to change font
  • Even tried different desktop environment (awesome and xfce)
  • Trying different shells (zsh, bash)

I have also tested with different users. A local user and one that uses likewise-open for domain authentication. With local user everything works, even they have same locale settings.

Here is output from running locale (both users have same locale settings):


As far as I have understand correctly LC_CTYPE is the environment variable that Urxvt uses.

I don't have any ideas how to fix this, but hopefully someone else has.

  • Just to clarify: Xterm works from the beginning, URxVt only after running a second instance? Did you reboot your machine after setting the locales? – mpy Apr 25 '13 at 9:06
  • Sorry my poor explanation. So none of terminals do not work from beginning, just terminals that I run from parent terminal works. I also rebooted my computer after settings locales. – rainmaker Apr 25 '13 at 9:15
  • I tried to make your question clearer that all terminals are affected and emphasized that you have these problems only with likewise-open authentification. That's all I can do, as I don't know how likewise-open works, but @Gabe's answer probably gives you the right direction. – mpy Apr 25 '13 at 11:09
  • Actually, I had missed the difference between local user and lightwise-open. The real answer is probably simply this: bugs.launchpad.net/ubuntu/+source/likewise-open/+bug/1162836 - the likewise-open pam config is broken; for Debian/Ubuntu a fix is packaged, for others I don't know, but comment #14 on that bug is probably the thing you need to check/fix. – Gabe Apr 26 '13 at 7:29
  • It was bug on likewise-open and I manage to fix it by following comment #3. Thanks to @Gabe for helping with this problem. – rainmaker Apr 29 '13 at 6:09

This looks as if you're setting $LC_CTYPE in your .profile or .bashrc or whatever. That hasn't been run before your first terminal, which therefore gets started without that in its environment:

init -(launches)-> Display manager -(launches)-> desktop env -(launches)-> terminal -(launches)-> shell

The shell then sources its startup file (.profile, .bashrc, .zshrc, .login, whichever it is for your shell), which sets the environment, and only then when you launch the terminal, it knows what locale settings it's supposed to use.

You need to set the LC_CTYPE further up the chain - where and how, depends on your desktop environment (I expect you're not using "just a window manager", probably gnome or KDE?), display manager (gdm or kdm or xdm or lightdm or whatever), init variant (traditional "sysv-style" or upstart).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.