Keep displaying --watchfd fds for a short time after they are closed, and don't clear the display at the end but just move the cursor past it (#81).

This commit is contained in:
Andrew Wood
2025-10-17 20:40:14 +01:00
parent 0aac6d6aac
commit 17ca4fc9c9
3 changed files with 106 additions and 71 deletions
+3 -9
View File
@@ -520,18 +520,12 @@ struct pvwatchfd_s {
off_t size; /* size of whole file, 0 if unknown */
off_t position; /* position last seen at */
struct timespec start_time; /* time we started watching the fd */
struct timespec fd_last_seen; /* time the fd was last seen open */
pid_t watch_pid; /* PID to watch */
struct timespec end_time; /* time the fd was marked as closed */
pid_t watch_pid; /* PID the fd belongs to */
int watch_fd; /* fd to watch */
bool closed; /* true once the fd is closed */
bool displayable; /* false if not displayable */
bool unused; /* true if free for re-use */
/*
* After the "watch_fd" is found to be closed, "fd_last_seen" stops
* being updated; when "fd_last_seen" is old enough, "unused"
* becomes true so the slot can be re-used. This allows fd
* information to be held on-screen for a short while after the fd
* is closed (#81).
*/
};
typedef struct pvwatchfd_s *pvwatchfd_t;