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

Re: chpwd() and completions functions



Tobias Gruetzmacher wrote:
> I have a slight problem here: My chpwd() function is messing up some
> completions. For example, the darcs completion has:
> 
> 	print $(cd $root; pwd -P)
> 
> This triggers my chpwd() function, so the output ends up containing the
> stuff my chpwd() function is writing out, which makes the completion
> system break at this point. Any ides how to fix this problem?

The completion system closes stdin so that normal output doesn't
go to the terminal.  You can detect this in your chpwd:

chpwd() {
  if [[ -t 0 ]]; then
    # stuff with normal terminal.
  fi
}

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



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