Index | Thread | Search

From:
Job Snijders <job@sobornost.net>
Subject:
Re: responsive watch wip
To:
Ted Unangst <tedu@tedunangst.com>
Cc:
tech@openbsd.org
Date:
Sat, 14 Jun 2025 18:58:50 +0000

Download raw body.

Thread
On Sat, Jun 14, 2025 at 01:50:21PM -0400, Ted Unangst wrote:
> I think I've figured out most of the interactions. Pause, update, etc.
> 
> Also should support unicode now.

OK job@

One suggestion below:

> @@ -216,19 +232,19 @@ main(int argc, char *argv[])
>  	signal_set(&ev_sighup, SIGHUP, on_signal, NULL);
>  	signal_set(&ev_sigterm, SIGTERM, on_signal, NULL);
>  	signal_set(&ev_sigwinch, SIGWINCH, on_signal, NULL);
> +	signal_set(&ev_sigchild, SIGCHLD, on_sigchild, NULL);
>  	signal_add(&ev_sigint, NULL);
>  	signal_add(&ev_sighup, NULL);
>  	signal_add(&ev_sigterm, NULL);
>  	signal_add(&ev_sigwinch, NULL);
> +	signal_add(&ev_sigchild, NULL);
>  
>  	event_set(&ev_stdin, STDIN_FILENO, EV_READ | EV_PERSIST, input, NULL);
>  	event_add(&ev_stdin, NULL);
>  	evtimer_set(&ev_timer, timer, NULL);
> -	evtimer_add(&ev_timer, &opt_interval.tv);
>  
>  	cur_buf = &buf0; prev_buf = &buf1;
> -	read_result(cur_buf);
> -	display(cur_buf, prev_buf, highlight_mode);

I would suggest to leave the display() call here as-is, because it causes the
'title bar' to be displayed right away (... while we wait for the child to
start emitting output).

With the display() call "watch 'sleep 5; date'" feels a bit nicer because
the operator sees _something_ right away.

Thank you for your work on this.

Kind regards,

Job