[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: background process not inheriting pts device
From: |
Thomas Dickey |
Subject: |
Re: background process not inheriting pts device |
Date: |
Thu, 11 Nov 2021 18:12:21 -0500 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Nov 11, 2021 at 05:26:10PM +0100, Luuk van Baal wrote:
> > > Thanks for your detailed response, my bad for missing the relevant release
> > > note.
> >
> > It's not obvious from reading it (I have the advantage of remembering why
> > I did these changes).
> >
> > > tty returns "not a tty" inside the script so while your assumption is
> > > correct,
> > > your suggested solution unfortunately does not help me.
> > >
> > > Sending the function where tty is called to the background
> > >
> > > foo & # where foo is a shell script function name
> > >
> > > , makes tty return "not a tty". I think this is expected behavior and the
> > > same
> > > behavior was present in ncurses 6.2.
> > >
> > > But the fact remains that in 6.2 the pts device was inherited by
> > > sub-shells whereas
> >
> > I'm puzzled why your trace shows file descriptors 0 and 1 open on
> > /dev/pty/10,
> > but opening 11 on /dev/pts/10 (if the first two aren't a tty, then the last
> > wouldn't be).
> >
> > > in 6.3 this is no longer the case. If this is intended I guess I will
> > > resort to
> > > manually passing the pts device of the main shell:
> > >
> > > TTY="$(tty)"
> > > TTY="$TTY" foo &
> >
> > yes... I don't see a way to improve this (reverting that change would
> > get different bug-reports). But there's that unexplained detail, so
> > I added a to-do item to investigate further.
> >
> > --
> > Thomas E. Dickey <dickey@invisible-island.net>
> > https://invisible-island.net
> > ftp://ftp.invisible-island.net
>
> The script redirects stderr to /dev/null (to not bother users with error
> messages
> regarding preview generation, it's a preview script for the file manager).
> I noticed when removing error redirection, the missing pts device for the
> sub-shell
> IS created and tput reports the correct terminal dimensions on ncurses 6.3.
I see (more a matter of how the file descriptor is passed around)
> Perhaps this can help you track something down but bear in mind that it is
> probably
> a very niche use-case with the preview script being spawned by the
> file-manager
> and the preview-script itself running inside a tmux/kitty/external terminal
> instance.
> I won't bother you with it further as the workaround is satisfactory for me.
sounds good (if it's not a "very niche use-case", I'll be getting more reports)
> Thanks again,
no problem (report bugs)
> Luuk van Baal <luukvbaal@gmail.com>
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature