Re: [tin-dev] [tin-bugs] BUG REPORT tin 2.6.0 release 20210823 ("Coleburn") - saving an article takes about 4 seconds
On Thu, Sep 23, 2021 at 03:53:35PM +0200, Vincent Lefevre wrote: [print_save_summary()]
I've tried, and in my case, the message remains permanently on screen. I can't reproduce that, it get's whiped after the delay, that's why the delay is there. So, the fact the message isn't whiped after the delay on my machine is another issue.
I also use linux + ncursesw so this is a bit confusing
But a user operation (such as the left arrow key in my example) should interrupt the delay.
something like the following - HIGHLY UNTESTED - SHOULD BE REVIEWED! - may work (simpler solutions highly appreciated): --- screen.c 2021-08-23 12:58:19.427594000 +0200 +++ /tmp/urs/screen.c 2021-09-23 16:55:00.798985976 +0200 @@ -169,10 +169,49 @@ #endif /* HAVE_COLOR */ cursoron(); my_flush(); + va_end(ap); + +#ifdef HAVE_SELECT + { + int nfds; + fd_set readfds; + struct timeval tv; + + forever { + FD_ZERO(&readfds); + FD_SET(STDIN_FILENO, &readfds); + tv.tv_sec = sdelay; + tv.tv_usec = 0; +# ifdef HAVE_SELECT_INTP + if ((nfds = select(STDIN_FILENO, (int *) &readfds, NULL, NULL, &tv)) == -1) { +# else + if ((nfds = select(STDIN_FILENO, &readfds, NULL, NULL, &tv)) == -1) { +# endif /* HAVE_SELECT_INTP */ + + if (errno != EINTR) { + perror_message("wait_message(select()) failed"); + free(tin_progname); + giveup(); + } else + return; + } else + break; + } + + if (nfds > 0) { + if (FD_ISSET(STDIN_FILENO, &readfds)) +# if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE) + ReadWch(); +# else + ReadCh(); +# endif /* MULTIBYTE_ABLE && !NO_LOCALE */ + } + } +#else (void) sleep(sdelay); +#endif /* HAVE_SELECT */ /* clear_message(); would be nice, but tin doesn't expect this yet */ - va_end(ap); }
On Thu, Sep 23, 2021 at 05:04:51PM +0200, Urs Janßen wrote:
But a user operation (such as the left arrow key in my example) should interrupt the delay.
something like the following - HIGHLY UNTESTED - SHOULD BE REVIEWED! - may work (simpler solutions highly appreciated):
If this is meant to interrupt a wait_message() with cursor left, then it doesn't work for me. | % grep -nr 'HAVE_SELECT' include/autoconf.h | include/autoconf.h:283:# define HAVE_SELECT 1 | include/autoconf.h:418:/* # undef HAVE_SELECT_INTP */ | % tin -V | Version: tin 2.6.0 release 20210823 ("Coleburn") Aug 23 2021 11:37:58 | Platform: | OS-Name = "darwin20.6.0" Dennis
participants (2)
-
Dennis Preiser -
Urs Janßen