ピアス エリック <eric_karatsujp@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 <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。