Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
FAQ title bar answer using chpwd()
- X-seq: zsh-workers 34669
- From: Andrew Janke <janke@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: FAQ title bar answer using chpwd()
- Date: Fri, 06 Mar 2015 22:40:11 -0500
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:content-type:content-transfer-encoding; s=smtpout; bh=Gs8SSscyZwuvHmEMPfjuOJtDNfM=; b=WWaZ8Yqahh0MzLUZ1 iqXXiFW7Pd0oaRxRcXNzDEMzvm11gY221AWPzFJLFWM258FT6j4p7AdLZLJwd+sX hmeK7m3nDEE3MZhIqanVmg0I1IwjBTpgH9VjXWIRa/L4O+bMphkY3Wdkld62QeM3 +0SXkQaUA5iLGZbAXZcAky3lN4=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi, ZSH workers,
I have a question about an answer in the ZSH FAQ. Is this the right list
to ask about it?
http://zsh.sourceforge.net/FAQ/zshfaq03.html#l23
Answer 3.6 suggests using chpwd() to emit terminal control sequences to
update the title bar for Apple's Terminal.app. This probably isn't the
right place to do it, because cd's can happen inside functions,
pipelines, and so on whose output is going to be captured for use
elsewhere. The terminal control sequences will contaminate the captured
output instead of going to the terminal.
There's at least one place in the wild where this causes an issue, with
Android development scripts:
https://github.com/robbyrussell/oh-my-zsh/issues/3524
The prompt or other known user-interaction output points are probably
the only safe place to emit terminal control sequences like this. So
precmd() is probably a better choice than chpwd() for this. It seems
like chpwd() should probably not be used to do anything that emits to
stdout, in case it's being captured.
Should the FAQ answer be updated to reflect this?
Cheers,
Andrew
Messages sorted by:
Reverse Date,
Date,
Thread,
Author