From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: PATCH: correct A04redirect.ztst so that it works on VSCode
Date: Thu, 30 Nov 2023 10:29:15 +0000 (GMT) [thread overview]
Message-ID: <817582883.313711.1701340155629@mail.virginmedia.com> (raw)
In-Reply-To: <CAH+w=7anCqHjnrRGnCFu9Hg6wnaySJPvXcjj6dmjev6UkvKmWw@mail.gmail.com>
> On 29/11/2023 17:45 GMT Bart Schaefer <schaefer@brasslantern.com> wrote:
>
>
> On Tue, Nov 28, 2023 at 2:18 PM German Riano <griano@yahoo.com> wrote:
> >
> > VSCode sometimes opens certain file descriptors whan you run a terminal nested in it.
>
> Thanks for the report and suggested fix. Question for zsh-workers --
> could we just do this?
>
> bad_fd_msg="${$( { exec 9>&-; echo >&9 } 2>&1)##*:}"
>
> That is, don't bother assigning myfd=99 in the first place (the test
> script never uses this value of myfd again) and in the subshell
> explicitly close an arbitrary FD before trying to use it? The only
> restriction seems to be that the descriptor tested must not be 0/1/2
> or we won't get the error. Also the pass through the "msg" temporary
> file seems unnecessary too?
Don't see why not.
Remember we also have the more predictable behaviour of
exec {myfd}>&1
to open a known $myfd, which we could then simply close. But apart from
purity points this may not gain very much.
pws
next prev parent reply other threads:[~2023-11-30 10:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <354453770.648505.1701209881415.ref@mail.yahoo.com>
2023-11-28 22:18 ` German Riano
2023-11-29 17:45 ` Bart Schaefer
2023-11-29 17:51 ` Bart Schaefer
2023-11-30 10:29 ` Peter Stephenson [this message]
2023-11-30 20:59 ` Bart Schaefer
2023-12-02 23:05 ` Bart Schaefer
2023-12-02 23:10 ` Bart Schaefer
2023-12-02 23:12 ` 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=817582883.313711.1701340155629@mail.virginmedia.com \
--to=p.w.stephenson@ntlworld.com \
--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).