* PATCH: zcalc prompt fix @ 2010-01-06 18:57 sergio 2010-01-07 21:33 ` Peter Stephenson 0 siblings, 1 reply; 11+ messages in thread From: sergio @ 2010-01-06 18:57 UTC (permalink / raw) To: zsh-workers Hello. There are problems when using color in ZCALCPROMPT. This is simple fix. --- /usr/share/zsh/functions/Misc/zcalc 2009-12-28 06:57:20.000000000 +0300 +++ zcalc 2010-01-06 14:55:15.000000000 +0300 @@ -152,7 +152,7 @@ done psvar[1]=$num -while vared -cehp "${(%)ZCALCPROMPT}" line; do +while vared -cehp "${ZCALCPROMPT}" line; do [[ -z $line ]] && break # special cases # Set default base if `[#16]' or `[##16]' etc. on its own. -- sergio. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-06 18:57 PATCH: zcalc prompt fix sergio @ 2010-01-07 21:33 ` Peter Stephenson 2010-01-07 23:11 ` sergio 0 siblings, 1 reply; 11+ messages in thread From: Peter Stephenson @ 2010-01-07 21:33 UTC (permalink / raw) To: zsh-workers On Wed, 06 Jan 2010 21:57:12 +0300 sergio <mailbox@sergio.spb.ru> wrote: > There are problems when using color in ZCALCPROMPT. Are you using colour the proper way for a prompt? ZCALCPROMPT="%F{red}%1v%f> " This works fine. In general, when making bug reports, please be much more specific than simply "there are problems". -- Peter Stephenson <p.w.stephenson@ntlworld.com> Web page now at http://homepage.ntlworld.com/p.w.stephenson/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-07 21:33 ` Peter Stephenson @ 2010-01-07 23:11 ` sergio 2010-01-08 0:15 ` Richard Hartmann 2010-01-08 9:28 ` Peter Stephenson 0 siblings, 2 replies; 11+ messages in thread From: sergio @ 2010-01-07 23:11 UTC (permalink / raw) To: zsh-workers On 08.01.2010 00:33, Peter Stephenson wrote: > Are you using colour the proper way for a prompt? Yes. > This works fine. No. Try to type long line. > In general, when making bug reports, please be much more specific than > simply "there are problems". Excuse me, but I don't know how to describe this problems. And I thought, that patch is the better explanation. -p for vared indicates, that the string will be taken as the prompt, and it doesn't need the prompt expansion flag (%). -- sergio. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-07 23:11 ` sergio @ 2010-01-08 0:15 ` Richard Hartmann 2010-01-08 1:00 ` sergio 2010-01-08 9:28 ` Peter Stephenson 1 sibling, 1 reply; 11+ messages in thread From: Richard Hartmann @ 2010-01-08 0:15 UTC (permalink / raw) To: sergio; +Cc: zsh-workers On Fri, Jan 8, 2010 at 00:11, sergio <mailbox@sergio.spb.ru> wrote: > No. Try to type long line. What line exactly? What do you do to trigger the bug? Can you reproduce it with zsh -f, and if not, what do you need to do so that you can reproduce it? RIchard ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-08 0:15 ` Richard Hartmann @ 2010-01-08 1:00 ` sergio 2010-01-08 9:21 ` Richard Hartmann 0 siblings, 1 reply; 11+ messages in thread From: sergio @ 2010-01-08 1:00 UTC (permalink / raw) To: zsh-workers On 08.01.2010 03:15, Richard Hartmann wrote: > What line exactly? What do you do to trigger the bug? > Can you reproduce it with zsh -f, and if not, what do you > need to do so that you can reproduce it? I thought it would be much easier. This is very simple bug. It occurs due to the incorrect prompt length calculations. It reproduces with zsh -f. % zsh -f % autoload zcalc % ZCALCPROMPT="%F{red}%1v%f> " % echo "$COLUMNS - `echo "${(%)ZCALCPROMPT}" | wc -c`" | bc 67 % zcalc 1> When you'll type 67'th character, prompt will disappear. It doesn't scroll to the right, but overwrites. After this you will not possible to edit beginning of the line anymore. -- sergio. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-08 1:00 ` sergio @ 2010-01-08 9:21 ` Richard Hartmann 0 siblings, 0 replies; 11+ messages in thread From: Richard Hartmann @ 2010-01-08 9:21 UTC (permalink / raw) To: zsh-workers On Fri, Jan 8, 2010 at 02:00, sergio <mailbox@sergio.spb.ru> wrote: > I thought it would be much easier. Having the example you gave, it is trivial for anyone to try and reproduce the bug. Also, it makes it easier (or even possible) to see what went wrong. > 1> When you'll type 67'th character, prompt will disappear. It doesn't > scroll to the right, but overwrites. After this you will not possible to > edit beginning of the line anymore. Confirmed for 4.3.9. Richard ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-07 23:11 ` sergio 2010-01-08 0:15 ` Richard Hartmann @ 2010-01-08 9:28 ` Peter Stephenson 2010-06-13 23:21 ` sergio 2010-06-13 23:22 ` sergio 1 sibling, 2 replies; 11+ messages in thread From: Peter Stephenson @ 2010-01-08 9:28 UTC (permalink / raw) To: zsh-workers On Fri, 08 Jan 2010 02:11:11 +0300 sergio <mailbox@sergio.spb.ru> wrote: > -p for vared indicates, that the string will be taken as the prompt, and > it doesn't need the prompt expansion flag (%). Ah, right, vared -p obeys the PROMPTPERCENT option so we don't need the (%) in any case. -- Peter Stephenson <pws@csr.com> Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-08 9:28 ` Peter Stephenson @ 2010-06-13 23:21 ` sergio 2010-06-13 23:54 ` Mikael Magnusson 2010-06-13 23:22 ` sergio 1 sibling, 1 reply; 11+ messages in thread From: sergio @ 2010-06-13 23:21 UTC (permalink / raw) To: zsh-workers Hello. This bug still presents in 4.3.10-13 in debian. > There are problems when using color in ZCALCPROMPT. > This is simple fix. > > --- /usr/share/zsh/functions/Misc/zcalc 2009-12-28 06:57:20.000000000 > +0300 > +++ zcalc 2010-01-06 14:55:15.000000000 +0300 > @@ -152,7 +152,7 @@ > done > > psvar[1]=$num > -while vared -cehp "${(%)ZCALCPROMPT}" line; do > +while vared -cehp "${ZCALCPROMPT}" line; do > [[ -z $line ]] && break > # special cases > # Set default base if `[#16]' or `[##16]' etc. on its own. On 01/08/2010 12:28 PM, Peter Stephenson wrote: > On Fri, 08 Jan 2010 02:11:11 +0300 > sergio<mailbox@sergio.spb.ru> wrote: >> -p for vared indicates, that the string will be taken as the prompt, and >> it doesn't need the prompt expansion flag (%). > > Ah, right, vared -p obeys the PROMPTPERCENT option so we don't need the > (%) in any case. -- sergio. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-06-13 23:21 ` sergio @ 2010-06-13 23:54 ` Mikael Magnusson 2010-06-14 11:11 ` sergio 0 siblings, 1 reply; 11+ messages in thread From: Mikael Magnusson @ 2010-06-13 23:54 UTC (permalink / raw) To: sergio; +Cc: zsh-workers That's not very surprising considering 4.3.10 was released before the fix. If you want debian to backport fixes, maybe you should talk to them? On 14 June 2010 01:21, sergio <mailbox@sergio.spb.ru> wrote: > Hello. > > This bug still presents in 4.3.10-13 in debian. > >> There are problems when using color in ZCALCPROMPT. >> This is simple fix. >> >> --- /usr/share/zsh/functions/Misc/zcalc 2009-12-28 06:57:20.000000000 > >> +0300 >> +++ zcalc 2010-01-06 14:55:15.000000000 +0300 >> @@ -152,7 +152,7 @@ >> done >> >> psvar[1]=$num >> -while vared -cehp "${(%)ZCALCPROMPT}" line; do >> +while vared -cehp "${ZCALCPROMPT}" line; do >> [[ -z $line ]] && break >> # special cases >> # Set default base if `[#16]' or `[##16]' etc. on its own. > > On 01/08/2010 12:28 PM, Peter Stephenson wrote: >> >> On Fri, 08 Jan 2010 02:11:11 +0300 >> sergio<mailbox@sergio.spb.ru> wrote: >>> >>> -p for vared indicates, that the string will be taken as the prompt, and >>> it doesn't need the prompt expansion flag (%). >> >> Ah, right, vared -p obeys the PROMPTPERCENT option so we don't need the >> (%) in any case. > > -- > sergio. > -- Mikael Magnusson ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-06-13 23:54 ` Mikael Magnusson @ 2010-06-14 11:11 ` sergio 0 siblings, 0 replies; 11+ messages in thread From: sergio @ 2010-06-14 11:11 UTC (permalink / raw) To: zsh-workers On 06/14/2010 03:54 AM, Mikael Magnusson wrote: > That's not very surprising considering 4.3.10 was released before the fix. > If you want debian to backport fixes, maybe you should talk to them? Thanks. No problems, but I've just thought that 4.3.10 was released after this fix. -- sergio. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PATCH: zcalc prompt fix 2010-01-08 9:28 ` Peter Stephenson 2010-06-13 23:21 ` sergio @ 2010-06-13 23:22 ` sergio 1 sibling, 0 replies; 11+ messages in thread From: sergio @ 2010-06-13 23:22 UTC (permalink / raw) To: zsh-workers On 01/08/2010 12:28 PM, Peter Stephenson wrote: > On Fri, 08 Jan 2010 02:11:11 +0300 > sergio<mailbox@sergio.spb.ru> wrote: >> -p for vared indicates, that the string will be taken as the prompt, and >> it doesn't need the prompt expansion flag (%). > > Ah, right, vared -p obeys the PROMPTPERCENT option so we don't need the > (%) in any case. > -- sergio. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-06-14 11:11 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-01-06 18:57 PATCH: zcalc prompt fix sergio 2010-01-07 21:33 ` Peter Stephenson 2010-01-07 23:11 ` sergio 2010-01-08 0:15 ` Richard Hartmann 2010-01-08 1:00 ` sergio 2010-01-08 9:21 ` Richard Hartmann 2010-01-08 9:28 ` Peter Stephenson 2010-06-13 23:21 ` sergio 2010-06-13 23:54 ` Mikael Magnusson 2010-06-14 11:11 ` sergio 2010-06-13 23:22 ` sergio
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).