On Thursday 10 February 2005 09:38, Gerald Combs wrote:
This functionality isn't built into bash, unfortunately. As a workaround I borrowed a function from the Bash Prompt HOWTO which truncates my path like so:
pow:...ery/long/path/indeed$
I'm looking for a way to use a real ellipsis instead of three dots _and_ have it work in different terminals on different platforms. It's 2005. Where's the Unicode-y goodness?
!!! WARNING UNICODE AHEAD -- MUST HAVE UNICODE ENABLED !!! !!! EMAIL IS UNICODE UTF-8 ENCODED !!!
Well first of all, woops on my earlier post.
Now, the following works in an XTerm on my Debian system:
PS1=…
The last character in the line above is a Unicode ellipse from the U+2026 block which can be included in any bash script in it's literal form if your locale is set to en_US.UTF-8. Here is an example of unicode literals in bash:
jclinton@mail:~$ cat myscript #!/bin/bash STRING=…Sigur\ Rós/ágætis_byrjun/$ echo $STRING jclinton@mail:~$ ./myscript …Sigur Rós/ágætis_byrjun/$
This also works in PuTTY on Windows XP; you must tell PuTTY that the console is UTF-8.
As for the non-GUI Linux console, it also works (theoretically) if one runs unicode_start first which could be included in one's special .bashrc AND if a suitable UTF-8 font is pressent. I couldn't find a font that had the ellipse character in it. Also, the Linux console is sorely lacking in a number of areas. In UTF-8 mode, you cannot use apps that draw lines on the screen or use the dead keys system to input arbitrary Unicode codes.
As for enabling Unicode on systems all you need to do, on Debian at least, is make /etc/environment file look like this:
jclinton@mail:/etc$ cat environment LANGUAGE="en_US:en_GB:en"
LANG=en_US.UTF-8
And that does it. It won't affect the console so things will still work there and XTerms, it seems, are intelligent enough in UTF-8 mode to handle all the things that they should be able to. Also, root is unaffected by LANG.