zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh workers <zsh-workers@zsh.org>
Subject: github PR to "Add command to improve robustness"
Date: Wed, 20 Sep 2023 19:20:03 +0200	[thread overview]
Message-ID: <9993-1695230403.478634@56vb.M_iZ.HRRz> (raw)

PR #101 adds "command" in several command substitutions in
_find_net_interfaces:

  https://github.com/zsh-users/zsh/pull/101/files

I would guess that the cause of the "bug" is function wrappers being
defined which wrap ifconfig and ip to apply colouring to their output.

There are a few random other cases where command is used as a
pre-command modifier in the completions like this. I'm not keen on
applying this selectively in one or two instances. And even less keen
on adding it everywhere. Shouldn't it be _call_program's job to apply
this? Though I've no idea how that can cope with pipelines. Or with
the few cases where we use it to run builtins. I've never been keen on
_call_program's use of eval - if the command comes from a style then
fair enough but for the predefined one it mostly isn't helping anything.
Any ideas?

Or should we just tell them to test something like [[ -t 1 ]] if they
insist on writing wrappers for system utilities that add colour.

Oliver


             reply	other threads:[~2023-09-20 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 17:20 Oliver Kiddle [this message]
2023-09-20 17:29 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9993-1695230403.478634@56vb.M_iZ.HRRz \
    --to=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).