[blfs-support] Wrong prompt and "file not found" with xterm - BLFS 7.6 - [SOLVED]

rhubarbpieguy at gmail.com rhubarbpieguy at gmail.com
Wed Dec 17 16:23:19 PST 2014

On 12/16/2014 05:02 PM, Bruce Dubbs wrote:
> rhubarbpieguy at gmail.com wrote:
>> My BLFS 7.6 xterm window displays the wrong prompt, doesn't recognize
>> aliases, and doesn't allow sourcing scripts.  Its prompt is "sh-4.3"
>> although I have PS1="/w >" in /etc/bashrc.  Aliases don't execute and
>> attempting to source a script results in "file not found."
>> However, if I exclude the "*VT100*locale: true" line in
>> /etc/X11/app-defaults/XTerm" all problems disappear.  With that one
>> change I have the correct prompt, can use aliases, and source scripts.
>> Although that fixes the problem, it still doesn't explain my error to 
>> me.
>> Everything else works quite well but I'm curious as to what I'm doing
>> wrong regarding X/xterm.  I hadn't the problem prior to BLFS 7.5 and
>> don't see what I'm doing differently.  Thoughts?
> The terminal is not your problem.  All the issues you mention have to 
> do with bash initialization.
> First of all you need to realize that starting an xterm does not run 
> /etc/profile (or ~/.bash_profile, ~/.bash_login, ~/.profile) by 
> default because the terminal invocation of bash is not started as a 
> login shell.  It only runs ~/.bashrc.
> The /etc/bashrc file needs to be sourced explicitly from the ~/.bashrc 
> file.
> The easiest way to debug your initialization scripts is to add an echo 
> statement as the first line of each script and see what is used and 
> the order that they are run.
> For example, place 'echo ~/.bashrc' in the ~/.bashrc file.
> The aliases and PS1 (and PS2/3/4 if they are customized) need to be 
> set for every subshell as they are not inherited from a parent shell.
>   -- Bruce
I believe I've found my error.  I changed the LANG variable in 
/etc/profile.d/i18n.sh.  I had LANG=en_US.iso88591 which apparently 
caused my problems.  I changed it to LANG=en_US.utf8 which fixed all 
problems without having to change the "*VT100*locale: true" line in 

The documentation states "locale -a" lists all locales. en_US.iso88591 
and en_US.utf8 are listed but the documentation warns UTF-8 locales are 
not supported well by some programs so I went with en_US.iso88591.

I probably should have known to use uft8 and it probably clearly states 
to use it somewhere in the documentation but I missed it. The 
"*VT100*locale: true" change I posted yesterday struck me as 
significant.  It led me to experiment with /etc/profile.d/i18n.sh and I 
found en_US.utf8 works through trial and error.

Live and learn (or at least I hope I have).

More information about the blfs-support mailing list