Hey all, I just did an upgrade install from a Japanese/SuSE 9.0 to Japanese/SuSE 9.1. On the terminal (any terminal), I'm getting weird behavior, and my first guess is it's UTF related. For example, if I type 'hello' on the terminal, then type alt-b (to go back a word) and then type 'goodbye' followed by return, here's what I get: $ hello $ gheoheohedhebheyheehello bash: goodbyehello: command not found You can see the text is input correctly, but the display is screwed up. Anyone else have this problem? I'm considering a fresh install, but I'd rather figure this out instead. Thanks for any ideas. Eric Pierce __________________________________________________ Do You Yahoo!? http://bb.yahoo.co.jp/
ピアス エリック
I just did an upgrade install from a Japanese/SuSE 9.0 to Japanese/SuSE 9.1.
On the terminal (any terminal), I'm getting weird behavior, and my first guess is it's UTF related.
For example, if I type 'hello' on the terminal, then type alt-b (to go back a word) and then type 'goodbye' followed by return, here's what I get:
$ hello $ gheoheohedhebheyheehello bash: goodbyehello: command not found
You can see the text is input correctly, but the display is screwed up.
Anyone else have this problem? I'm considering a fresh install, but I'd rather figure this out instead.
Which shell are you using? bash?
If it is bash, what is your prompt? You can see how you prompt is set
with
echo $PS1
--
Mike FABIAN
--- Mike FABIAN
ピアス エリック
さんは書きました: I just did an upgrade install from a Japanese/SuSE 9.0 to Japanese/SuSE 9.1.
On the terminal (any terminal), I'm getting weird behavior, and my first guess is it's UTF related.
For example, if I type 'hello' on the terminal, then type alt-b (to go back a word) and then type 'goodbye' followed by return, here's what I get:
$ hello $ gheoheohedhebheyheehello bash: goodbyehello: command not found
You can see the text is input correctly, but the display is screwed up.
Anyone else have this problem? I'm considering a fresh install, but I'd rather figure this out instead.
Which shell are you using? bash?
If it is bash, what is your prompt? You can see how you prompt is set with
echo $PS1
Bingo! (Yes, I'm using Bash.) I set $PS1 to "$ " and everything worked correctly. I haven't changed my PS1 variable for 2+ years. Something else must have changed (bash?) that it doesn't work properly now. Here's what I had: \[\033[0;37m\][$(date +%I:%M%P)]\[\033[34m\][\u:\[\033[1;32m\]\W\[\033[34m\]]$\[\033[0m\] Maybe the color escape sequences aren't supported the same now? I've no idea. I'll play around with it. Thanks for the tip. I haven't been on the list for a while... I hope all has been well with you Mike. Eric PIerce __________________________________________________ Do You Yahoo!? http://bb.yahoo.co.jp/
ピアス エリック
Bingo! (Yes, I'm using Bash.) I set $PS1 to "$ " and everything worked correctly. I haven't changed my PS1 variable for 2+ years. Something else must have changed (bash?) that it doesn't work properly now.
This never worked in multibyte locales. But until now you didn't notice because you didn't use UTF-8. In single byte locales like en_US there are no problems. In multibyte locles like ja_JP.eucJP there are problems, but they are not as bad as in UTF-8 because every Japanese character uses 2 bytes in EUC-JP and uses two columns in the terminal, i.e. when calculating positions on the command line, some things accidentally work out right in ja_JP.eucJP locale (but not everything). In ja_JP.UTF-8, every Japanese character uses 3 bytes but still 2 columns on the command line of course, this makes errors in the position calculation very obvious.
Here's what I had: \[\033[0;37m\][$(date +%I:%M%P)]\[\033[34m\][\u:\[\033[1;32m\]\W\[\033[34m\]]$\[\033[0m\]
Maybe the color escape sequences aren't supported the same now?
The problem is caused by invisible characters in the prompt. From the
bash man page:
[...] Bash allows these prompt strings to be cus
tomized by inserting a number of backslash-escaped special
characters that are decoded as follows:
\[ begin a sequence of non-printing characters,
which could be used to embed a terminal con
trol sequence into the prompt
\] end a sequence of non-printing characters
That means all stuff between \[ and \] should be ignored when
calculating the columns on the command line because all this stuff
doesn't produce any output.
Unfortunately this doesn't work right in multibyte locales, which
includes all UTF-8 locales. It only works well in single byte locales.
This is a but in bash of course, but until this is fixed the only
workaround is to use a prompt without this.
The default bash prompt on SuSE Linux 9.0/9.1 in UTF-8 locales is:
PS1="\u@\h:\w> "
in single byte locales it defaults to a more complicated prompt which
uses invisible characters.
--
Mike FABIAN
participants (2)
-
Mike FABIAN
-
ピアス エリック