zsh-users
 help / color / mirror / code / Atom feed
* chpwd() and completions functions
@ 2006-07-24 11:51 Tobias Gruetzmacher
  2006-07-24 12:01 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Gruetzmacher @ 2006-07-24 11:51 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Hi,

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?

Greetings, Tobi

-- 
GPG-Key 0xE2BEA341 - signed/encrypted mail preferred
My, oh so small, homepage: http://portfolio16.de/
http://www.fli4l.de/ - ISDN- & DSL-Router on one disk!
Registered FLI4L-User #00000003

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: chpwd() and completions functions
  2006-07-24 11:51 chpwd() and completions functions Tobias Gruetzmacher
@ 2006-07-24 12:01 ` Peter Stephenson
  2006-07-24 12:51   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2006-07-24 12:01 UTC (permalink / raw)
  To: zsh-users

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@csr.com>                  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: chpwd() and completions functions
  2006-07-24 12:01 ` Peter Stephenson
@ 2006-07-24 12:51   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2006-07-24 12:51 UTC (permalink / raw)
  To: zsh-users

Peter Stephenson wrote:
> The completion system closes stdin so that normal output doesn't
> go to the terminal.

Obviously that's garbled and I meant "...input doesn't come from...".
I think the intention is to prevent any possibility of a hang waiting
for input from a command:  in this case an error is preferable.

-- 
Peter Stephenson <pws@csr.com>                  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-24 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-24 11:51 chpwd() and completions functions Tobias Gruetzmacher
2006-07-24 12:01 ` Peter Stephenson
2006-07-24 12:51   ` Peter Stephenson

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).