Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Using rxvt-unicode-9.11 and mc-4.7.5.2, and using zsh-4.3.11 as my login shell, I find that I get strange characters, eg â instead of lines being drawn.

Interestingly however, launching urxvt from any root shell, and then running mc inside of that renders the lines correctly.

In Xdefaults I am not setting a font.

I thought that any child shells should inherit the same as the parent shell, but clearly here it is not.

Exports in parent:

COLON_SEPARATED=MOZ_PLUGIN_PATH
COLORFGBG='7;default'
COLORTERM=rxvt
CONFIG_PROTECT_MASK='/lib64/udev/rules.d /etc/dconf/db /etc/ca-certificates.conf'
CVS_RSH=ssh
DESKTOP_STARTUP_ID=awesome/urxvtc/2194-57-alipc-desktop-ex_TIME28147172
DISPLAY=:0.0
GDK_USE_XFT=1
GPG_AGENT_INFO=/tmp/gpg-CeLaPY/S.gpg-agent:2191:1
HOME=/home/ali
INFOPATH=/usr/share/info
JAVAC=/usr/bin/javac
JAVACMD=/usr/bin/java
JAVA_HOME=/usr/lib64/jdk
LANG=en_GB.utf8
LDPATH=/usr/local/lib:/usr/lib64/nss:/usr/lib64/vdpau:/usr/lib64/qt4
LESS='-R -M --shift 5'
LOGNAME=ali
MAIL=/var/mail/ali
MANPATH=/usr/local/share/man:/usr/share/man
MOZ_PLUGIN_PATH=/usr/lib64/mozilla/plugins:/opt/netscape/plugins
PAGER=/usr/bin/less
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib64/jdk/bin:/usr/lib64/jre/bin:/opt/bin:/usr/lib64/jdk/bin:/usr/lib64/jre/bin
PWD=/home/ali
SHELL=/bin/zsh
SHLVL=2
SSH_AGENT_PID=2193
SSH_AUTH_SOCK=/tmp/ssh-RhQcEipf2192/agent.2192
TERM=rxvt-256color
TERMINFO=/usr/share/terminfo
USER=ali
WINDOWID=20972128
XAUTHORITY=/home/ali/.Xauthority
_=export

Exports in child:

COLON_SEPARATED=MOZ_PLUGIN_PATH
COLORFGBG='7;default'
COLORTERM=rxvt
CONFIG_PROTECT_MASK='/lib64/udev/rules.d /etc/dconf/db /etc/ca-certificates.conf'
CVS_RSH=ssh
DESKTOP_STARTUP_ID=awesome/urxvtc/2194-57-alipc-desktop-ex_TIME28147172
DISPLAY=:0.0
GDK_USE_XFT=1
GPG_AGENT_INFO=/tmp/gpg-CeLaPY/S.gpg-agent:2191:1
HOME=/home/ali
INFOPATH=/usr/share/info
JAVAC=/usr/bin/javac
JAVACMD=/usr/bin/java
JAVA_HOME=/usr/lib64/jdk
LANG=en_GB.utf8
LDPATH=/usr/local/lib:/usr/lib64/nss:/usr/lib64/vdpau:/usr/lib64/qt4
LESS='-R -M --shift 5'
LOGNAME=ali
MAIL=/var/mail/ali
MANPATH=/usr/local/share/man:/usr/share/man
MOZ_PLUGIN_PATH=/usr/lib64/mozilla/plugins:/opt/netscape/plugins
OLDPWD=/home/ali
PAGER=/usr/bin/less
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib64/jdk/bin:/usr/lib64/jre/bin:/opt/bin:/usr/lib64/jdk/bin:/usr/lib64/jre/bin
PWD=/home/ali
SHELL=/bin/zsh
SHLVL=4
SSH_AGENT_PID=2193
SSH_AUTH_SOCK=/tmp/ssh-RhQcEipf2192/agent.2192
STY=27048.pts-2.alipc-desktop-ex
TERM=rxvt-256color
TERMINFO=/usr/share/terminfo
USER=ali
WINDOW=0
WINDOWID=27262984
XAUTHORITY=/home/ali/.Xauthority
_=export

Thanks.

Edit: more information + combinations: .zshrc:

# The following lines were added by compinstall

zstyle ':completion:*' completer _expand _complete _ignored
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle :compinstall filename '/home/ali/.zshrc'

autoload -U zutil
autoload -Uz compinit
autoload -U complist
compinit
autoload -U colors
colors
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd extendedglob notify
unsetopt beep
bindkey -v
# End of lines configured by zsh-newuser-install

#export PS1="%n#%d>"

PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%d %{$reset_color%}%#"
RPROMPT="[%{$fg[yellow]%}%T%{$reset_color%}]"

locale -a: C en_GB.utf8 en_US.utf8 POSIX

exports from 'urxvt -e zsh -f': - A working set!

COLORFGBG='7;default'
COLORTERM=rxvt
DESKTOP_STARTUP_ID=awesome/urxvt/2199-28-alipc-desktop-ex_TIME11280170
DISPLAY=:0.0
GPG_AGENT_INFO=/tmp/gpg-d5ZFvz/S.gpg-agent:2196:1
HOME=/home/ali
LOGNAME=ali
MAIL=/var/mail/ali
PATH=/bin:/usr/bin:/usr/local/bin
PWD=/home/ali
SHELL=/bin/zsh
SHLVL=2
SSH_AGENT_PID=2198
SSH_AUTH_SOCK=/tmp/ssh-sPZhKOhV2197/agent.2197
TERM=rxvt-unicode-256color
TERMINFO=/usr/share/terminfo
USER=ali
WINDOWID=23068680
XAUTHORITY=/home/ali/.Xauthority
_=export

Note: I did try setting my TERM via .Xdefaults, to the one that worked in the 'clean' window:

urxvt*termName:  rxvt-unicode-256color

Though this had no effect, so it is not TERM that affects this.

share|improve this question
    
In case it helps, colours in vim are not correct in the root window, but as with above, render correctly in any child urxvt processes. –  Ali Lown Jun 5 '11 at 20:48
add comment

2 Answers

up vote 0 down vote accepted

You have the environment variable STY set in the child. Given its presence and its contents, the child is actually running inside Screen. Your environment is not correct (i.e. it's lying to applications) in two ways:

  • You have a Unicode terminal, and you're trying to display non-ASCII characters. Yet your environment doesn't define LC_CTYPE. If you want to display non-ASCII characters, you must set LC_CTYPE, usually to something like en_US.UTF-8.
  • You are using Screen, the terminal type ($TERM) is declared to be rxvt-256color.

There's probably something wrong in your .zshrc regarding TERM. For LC_CTYPE, if you always work in a UTF-8 locale, it's easiest to set it in your .profile.

share|improve this answer
    
Regarding screen: Yes, I have it set in my .zlogin to run screen -xRR, so I was running inside screen. Removing this, and setting LC_CTYPE isn't affecting it though. –  Ali Lown Jun 6 '11 at 8:17
    
@Ali: Did you set LC_CTYPE to a valid locale (run locale -a to see a list of valid locales)? Try rxvt-unicode -e zsh -f. Also, do you have a terminfo entry for rxvt-256color? Try with TERM=rxvt or TERM=xterm, does it make a difference? –  Gilles Jun 6 '11 at 10:06
    
Put some more info in the OP. When running urxvt-e zsh -f, and then running mc it does work, and draws the correct lines instead, suggesting it is an issue with zsh. Added .zshrc above too. –  Ali Lown Jun 6 '11 at 10:43
    
@Ali: 1. I made a mistake in my answer (will fix): you've set LANG, and that's equivalent to setting LC_CTYPE (for the purpose at hand). So that's not the problem. 2. You're missing several environment variables in your zsh -f window, do you normally start a login shell? In which case: 2a. you shouldn't; 2b. show us your .zprofile and .zlogin. –  Gilles Jun 6 '11 at 20:47
    
@Giles: 2a) How do I know?. All shells launched via Awesome WM, which is launched via .xinitrc from slim. 2b) .zprofile and .zlogin are non-existant. –  Ali Lown Jun 6 '11 at 22:06
show 3 more comments

Faced a similar issue. Changed the encoding of my putty session to match the encoding used in terminal. Thus, changed the putty configuration -> translation to UTF-8

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=

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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