bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

background process not inheriting pts device


From: Luuk van Baal
Subject: background process not inheriting pts device
Date: Thu, 11 Nov 2021 02:46:36 +0100

Hi,

Disclaimer I am not familiar with the inner workings of ncurses/relevant jargon.
I'm just the author of a shell script[1] for file-manager nnn[2] which relied 
on tput cols/lines to get the terminal dimensions.

With ncurses release 6.3, the behavior for tput has changed for the script and 
no longer reports the correct terminal dimensions but instead reports what I 
assume to be a set of default values, namely 80 and 24.

The main loop for this script is sent to the background and it seems with 6.3 
this background process no longer "inherits" the pts device of the parent 
process which was the case on earlier ncurses versions. An additional file 
descriptor for the background process is missing in 6.3:

ls -l /proc/<script PID>/fd
0 -> /dev/pts/10
1 -> /dev/pts/10
10 -> /home/luuk/.config/nnn/plugins/preview-tui
11 -> /dev/pts/10 # missing in 6.3
2 -> /dev/null

I've had to resort to writing the correct terminal dimensions to a temporary 
file from the mainprocess and its WINCH handler which works. I would like to 
avoid writing to a tempfile if it can be avoided however and I wonder if this 
new behavior is documented/expected or a regression.

I couldn't find anything relevant in the release notes.

Thanks -- Luuk



[1] https://github.com/jarun/nnn/blob/master/plugins/preview-tui
[2] https://github.com/jarun/nnn/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]