Setting LC_CTYPE in XTerm under MDK/WM
Currently I run mdk9.1 and windowmaker 0.8. In windowmaker I run an XTerm.
First I had problems with my man pages in this XTerm: All "-" was replaced by weird stuff. I found a solution: export LC_CTYPE=C. My problem is to load this at startup! I tried to put it in my ~/.bashrc With this setting LC_CTYPE is set right in console (ie not under X), but in my XTerm (under X) I have: $ echo $LC_CTYPE da_DK.UTF-8 Where should this command be placed? (~/.bash_profile doesn't work) Thx in advance |
Depends on whether the xterms in wm are
login shells or not. You could try to symlink (ln -s ~/.bashrc ~/.bash_login) Cheers, Tink |
Nope, that doesnt work. Not a login shell.
|
is ~/.bashrc executable?
Cheers, Tink |
No it wasn't. (Should it be?) Anyway I tried to make it exec. and it didn't work :-(
Could it be, that my XTerm is started with an argument setting the locale (LC_CTYPE)? Where can I find out? What starts the XTerm? Thanx! |
Quote:
What's the error message? Quote:
have a look at ~ ls ls -Ald .* Maybe there's another .bash-file (.bash_profile) or .profile that messes with you? Cheers, Tink |
My .bash_profile is just:
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi export PATH=$PATH:$HOME/bin unset USERNAME My .bashrc reads: # .bashrc # User specific aliases and functions [snip] # This locale setting should fix the "-" and "--" in man pages. # Works in console, but is overwritten somewhere else in WM. export LC_CTYPE=C echo "LC_CTYPE="$LC_CTYPE # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi I tried to place "export LC_CTYPE=C" in .bash_profile too, but that doesnt work. How do i run my XTerm: I use WM so I can run both XTerm and rxvt from the menu. They run: xterm -sb rxvt -bg black -fg white -fn fixed (I then start them automatically from the dock.) Both XTerm and rxvt has LC_CTYPE=da_DK.UTF-8 |
I found out that if I run
bash --login in my XTerm, it sets LC_CTYPE=C. Can this be any help? My /etc/bashrc is: # /etc/bashrc echo "Loading /etc/bashrc" # System wide functions and aliases # Environment stuff goes in /etc/profile # by default, we want this to get set. # Even for non-interactive, non-login shells. if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then umask 002 else umask 022 fi # are we an interactive shell? if [ "$PS1" ]; then case $TERM in xterm*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' ;; *) ;; esac [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " if [ -z "$loginsh" ]; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -x $i ]; then . $i fi done fi fi unset loginsh |
# /etc/profile.d/lang.sh - set i18n stuff
sourced=0 if [ -n "$GDM_LANG" ]; then sourced=1 LANG="$GDM_LANG" else # only source one of the possible files, and in that order; # if system wide and user config are mixed and different, umpredictable # things will happen... for langfile in $HOME/.i18n /etc/sysconfig/i18n ; do [ -f $langfile -a "$sourced" = "0" ] && . $langfile && sourced=1 done fi if [ "$sourced" = 1 ]; then if [ -n "$LANG" ] ; then [ "$LANG" = "C" ] && LANG="en_US" export LANG else unset LANG fi [ -n "$LANG" ] && export LANG || unset LANG [ -n "$LC_ADDRESS" ] && export LC_ADDRESS || unset LC_ADDRESS [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE ################################################### [snip] How does this affect LC_CTYPE in a non-login shell? |
Good question ... not sure how stuff is
dealt with in wm, but could the shells inherit from the wm process which most likely will be a login-shell? :) Cheers, Tink |
Problem Solved!!!
I'm happy to anounce that the problem is solved. I found that:
~/.bashrc calls etc/profile.d/lang.sh, which in turn modifies LC_CTYPE (in some way i dont understand (yet)). So placing export LC_CTYPE=C ABOVE # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi makes my manual pages happy :-) Many thanks to you, Tinkster, for being so patient with me. |
Another way: to set or remove 'LC_CTYPE=' to the desired value in /etc/environmet.
I |
All times are GMT -5. The time now is 04:15 AM. |