On OpenBSD, in order to appropriately see language specific characters in X sessions all I need to do is set LC_CTYPE to one of the values listed using locale -a. I do this by adding export LC_CTYPE=xx_YY.UTF-8 to the .Xsession file.

Is there any way to get similar result for tty sessions?

  • you could also configure your shell (e.g. ksh) to set suitable locale environment variables
    – thrig
    Commented Sep 28, 2022 at 1:31
  • any details or suggestions on how to do this?
    – zajer
    Commented Sep 28, 2022 at 11:34

1 Answer 1


SSH, wscons(4), or other means of terminal access do not fall under the X11 configuration. One means to configure the resulting shell of such access methods is to set suitable environment variables in the shell configuration. Assuming ksh(1), a typical way to do this would be to set

export ENV=/home/user/.kshrc

in ~/.profile and then in the ~/.kshrc file set the necessary export LC_CTYPE=... value. Other shells (e.g. fish or zsh) will vary in how and in what file environment variables are set, check their manual for details.

Another method would be to create a new (or configure an existing) login class to set suitable environment variables for the user(s) in question; see setenv under login.conf(5). doas.conf(5) may also need (a different) setenv if the locale settings need to work as another user.

  • Unless I'm doing something wrong, it does't work. I have added the mention export command to .kshrc file and what you suggested to .profile. It certainly modifies how characters are displayed but the result is different than expected. For example it changes the "-" (hyphen) in man pages, which is weird btw, but all language specific symbols are still incorrectly.
    – zajer
    Commented Oct 2, 2022 at 23:33

You must log in to answer this question.

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