Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: correct A04redirect.ztst so that it works on VSCode
- X-seq: zsh-workers 52344
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: correct A04redirect.ztst so that it works on VSCode
- Date: Thu, 30 Nov 2023 10:29:15 +0000 (GMT)
- Archived-at: <https://zsh.org/workers/52344>
- Importance: Normal
- In-reply-to: <CAH+w=7anCqHjnrRGnCFu9Hg6wnaySJPvXcjj6dmjev6UkvKmWw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <354453770.648505.1701209881415.ref@mail.yahoo.com> <354453770.648505.1701209881415@mail.yahoo.com> <CAH+w=7anCqHjnrRGnCFu9Hg6wnaySJPvXcjj6dmjev6UkvKmWw@mail.gmail.com>
> On 29/11/2023 17:45 GMT Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
>
> On Tue, Nov 28, 2023 at 2:18 PM German Riano <griano@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author