bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: under cygwin incorrect prompt display with color code


From: Kelvin Lee
Subject: RE: under cygwin incorrect prompt display with color code
Date: Tue, 31 Aug 2004 14:15:53 +1000

Eventually, I found the real problem.
The problem is that wcwidth() is sort of broken (at least behave differently to all other platforms which I can test including Linux, Solaris and AIX) on cygwin.

On cygwin, wcwidth(w) return 0 for (c >= 0x01 && c <= 0x1f) || c == 0x7f.
Whereas on Linux, Solaris and AIX, wcwidth() returns -1.

Regards,
Kelvin Lee
// LANSA Product Centre
// LANSA Pty Ltd
// phone: +61 (2) 8907 0231
// mailto:Kelvin.Lee@lansa.com.au


> -----Original Message-----
> From: Kelvin Lee
> Sent: Tuesday, August 17, 2004 12:18 PM
> To: 'bug-bash@gnu.org'
> Subject: under cygwin incorrect prompt display with color code
>
>
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: cygwin
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash.exe'
> -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin'
> -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc'
> -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash'
> -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS  -I.  -I. -I./include
> -I./lib   -pipe -O2
> uname output: CYGWIN_NT-5.0 kelvinpc 1.5.10(0.116/4/2)
> 2004-05-25 22:07 i686 unknown unknown Cygwin
> Machine Type: i686-pc-cygwin
>
> Bash Version: 3.0
> Patch Level: 0
> Release Status: release
>
> Description:
>     Under cygwin with the following prompt:
>      
> PS1="\[\033[106m\]\u@\h\[\033[m\]:\[\033[103m\]\w\[\033[m\]:\! \$ "
>     Inside xterm, the prompt would become:
>       joe@machine:~:999 $ $
>     Notes the double $ signs. (Notes joe and machine are
> displayed in colors correctly.)
>     The same PS1 works well on Linux boxes.
>     So looks like a cygwin specific problem.
>     Occasionally, the prompt can be displayed correctly (e.g.
> after pressing Tab for autocompletion).
>     But then the command line would be displayed incorrectly,
> looks like this:
>       joe@machine:~:999 $ $ ls t[TAB]
>       test/ tmp/
>       joe@machine:~:999 $ ls tt
>     Notes the second prompt is correct now but the last 't'
> character becomes 'tt'.
>
> Repeat-By:
>     Simply set:
>      
> PS1="\[\033[106m\]\u@\h\[\033[m\]:\[\033[103m\]\w\[\033[m\]:\! \$ "
>     under a cygwin xterm.
>
> Regards,
> Kelvin Lee
> // LANSA Product Centre
> // LANSA Pty Ltd
> // phone: +61 (2) 8907 0231
> // mailto:Kelvin.Lee@lansa.com.au
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]