zsh-workers
 help / color / mirror / code / Atom feed
* github PR to "Add command to improve robustness"
@ 2023-09-20 17:20 Oliver Kiddle
  2023-09-20 17:29 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2023-09-20 17:20 UTC (permalink / raw)
  To: Zsh workers

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


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

* Re: github PR to "Add command to improve robustness"
  2023-09-20 17:20 github PR to "Add command to improve robustness" Oliver Kiddle
@ 2023-09-20 17:29 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2023-09-20 17:29 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: Zsh workers

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

On Wed, Sep 20, 2023, 10:20 AM Oliver Kiddle <opk@zsh.org> wrote:

>
> 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.
>
> Any ideas?
>

If _call_program runs in a subshell, it could start with

unfunction -m '*'

That might be a bit violent, though.  Maybe a zstyle listing functions to
ignore?

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

That would certainly be best practice.

>

[-- Attachment #2: Type: text/html, Size: 1413 bytes --]

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

end of thread, other threads:[~2023-09-20 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20 17:20 github PR to "Add command to improve robustness" Oliver Kiddle
2023-09-20 17:29 ` Bart Schaefer

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