Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppress print_exit_value for single function
- X-seq: zsh-users 23386
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Suppress print_exit_value for single function
- Date: Sat, 5 May 2018 18:11:41 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tl/eSL1hzmJKeWzUDm8PBN4bS2dUS5pE4aHsmdJQWys=; b=Le/IBlXM81yJkEc9N89X8aiOZLGXkMJmYqLJO2xM8ALttsQ7+n2dHwKx1GeIcMElnV U+OqRNcQN0UYz0o62izGDhzKIrmqCDRvfbsN4edMQbb/kA2FLZU+AzcNiwTa85QK3/Th W7wpzrJLqyl1Rt/hlZJISh91xvyE8nFYcNd1WUj2Tw1qpxI+pj6mJbkVO4on4qZRKvWV HzjftLWyb00BucyUkOhOLDcDfBk2F067hTQJfW+6seZYxtYl0gV0IfsxUbY2kANI39bm uLj5H+3ynDmqC8EHpNj5UWGlL1KQLuo44NnP3YLuGCaWKexCIF4j9ptvHEyLsCsYKXI0 dEGw==
- In-reply-to: <20180505151054.k4iwezfirs3uemsk@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBUGJqa19ix_qwDE+mtvTwYfZPfQ4LPNfUT67jGtFZx7w@mail.gmail.com> <20180505151054.k4iwezfirs3uemsk@tarpaulin.shahaf.local2>
On 5 May 2018 at 17:10, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> (Right? I haven't tested this, I'm just going by your description)
>
It has a basic practical meaning: feature of various prompts to show a
skull or some red or other indicator of last command ending with error
stops working when sched function always returns 0.
So, isn't the answer to that to teach the C code not to write the return
> value
> of a sched function to the global value of $? — but to keep printing
> printexitvalue warnings for sched functions?
>
I wrote 2 plugins that resulted in user reporting this problem
(printexitvalue spam). The aim at "user might want reports from background
tasks" is problematic when it's noticed that background tasks malform
foreground $? value. It is possible to suppress this malforming (local
ret=$? at sched function start, return $ret at the end), but then it's not
sched's function own return code, it's repeated foreground $? code, so it
shouldn't be reported. I think proper resolution of this is treating $?
value as sacred. We already are steps back from this status of $? as
various plugins run background code and just return 0. Teaching functions
to not write to $? at C level seems to be very rebellious.
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author