Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Parsing change between 3.0.2 and 3.0.4?



> Was there some change in parsing between 3.0.2 and 3.0.4 that causes me
> to get this error message:
> parse error near `\n'
> when sourcing a file containing this:
> [ "${(M)TERM#xterm}" = xterm ] && \
>   {stty -istrip -ixon ; function chpwd {print -Pn "\e]2;%m: $PWD\C-g"}}

Yes, there were some brace related changes since 3.0.2 since
IGNORE_BRACES did not work properly in some cases.  Now the closing brace
has to be followed by a blank or one of ; | &

[ "${(M)TERM#xterm}" = xterm ] && \
  {stty -istrip -ixon ; function chpwd {print -Pn "\e]2;%m: $PWD\C-g"} }

But the proper syntax required by POSIX is

[ "${(M)TERM#xterm}" = xterm ] && \
  { stty -istrip -ixon ; function chpwd {print -Pn "\e]2;%m: $PWD\C-g";};}

That works even if IGNORE_BRACES is set.  I'd strongly recommend using
this syntax.

Zoltan



Messages sorted by: Reverse Date, Date, Thread, Author