You are not logged in.

#1 2016-12-08 12:52:08

orrin5250
Member
Registered: 2016-10-12
Posts: 30

[SOLVED] Special characters do not render using zsh / oh-my-zsh

Using xfce4-terminal and bash, special characters render correctly. 

I have tested this entering Ctrl-u 219[0,1,2,3] which properly displays:

← ↑ → ↓

However, using z shell I simply get the following for each attempt:

<ffffffff><ffffffff><ffffffff>

Other posts have alluded to the possibility of a locale issue.

I'm not sure what exactly is relevant here, but just in case:

[orrin@archie ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE=C
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=
[orrin@archie ~]$ echo $LANG
en_US.UTF-8
[orrin@archie ~]$ cat .zshrc

export ZSH=$HOME/.oh-my-zsh
export TERM=xterm-256color
export LANG=en_US.UTF-8

ZSH_THEME="ys"

plugins=(git zsh-syntax-highlighting)

source $ZSH/oh-my-zsh.sh

Of note:  I tested reverting to zsh WITHOUT oh-my-zsh but no luck fixing the problem.  I have also tried different fonts.

My guess is that somehow my zsh settings are not right (since everything behaves properly with bash).  Does anyone have any ideas?

Last edited by orrin5250 (2016-12-08 13:39:08)

Offline

#2 2016-12-08 13:04:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,659
Website

Re: [SOLVED] Special characters do not render using zsh / oh-my-zsh

orrin5250 wrote:

My guess is that somehow my zsh settings are not right ...

That is very easy to test - please do so.  Move/rename your zshrc and try without any user configs.

However, I'm also suspect of the input methods.  Perhaps it is because I use vi mode, but pressing the keys you describe does not generate those characters, but the following does:

echo -e '\u2190\u2191\u2192\u2193'

If this works for you, then it is an input processing issue, if this fails, it is an output issue (locale or font perhaps).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-12-08 13:38:49

orrin5250
Member
Registered: 2016-10-12
Posts: 30

Re: [SOLVED] Special characters do not render using zsh / oh-my-zsh

Thanks Trilby.  You helped me solve the problem. 

I did as you asked.  Your input command with barebones zsh (no user configs) yielded:

zsh: character not in range

..ergo ouput issue.

This oh-my-zsh discussion specifically mentions that setting LC_CTYPE to a non-UTF-8 locale can create an error. 

This was precisely the case in my locale settings (see above...LC_CTYPE=C).  I am not sure how this happened. 

export LC_CTYPE="en_US.UTF-8"

And now all is well and acting as I'd hoped.  The change is maintained after reboot.

Offline

Board footer

Powered by FluxBB