[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before block
From: |
Brand Huntsman |
Subject: |
Re: [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before blocking on it |
Date: |
Fri, 17 May 2019 00:48:01 -0600 |
On Thu, 16 May 2019 15:48:58 +0200
Benno Schulenberg <address@hidden> wrote:
> What is needed is a way to abort the reading
> process, as requested in https://savannah.gnu.org/bugs/?44907.
Well, the reading process isn't the issue with FIFOs, its the opening.
That SIGINT code will enable ^C when reading and maybe also writing, but I
couldn't get it to work with opening, it segfaults inside open(). It should be
possible because open() can return EINTR if interrupted.
The new patch adds a cancel option when FIFO is empty. The ^C via SIGINT for
reading and writing a file wouldn't be rebindable, so it makes sense to not
allow rebinding it when opening a FIFO. And some of the FIFO code could be
moved to functions and used to allow ^C when opening a FIFO for writing.
The second patch updates the titlebar and clears edit window. It looks better
when nano is starting up and waiting on a fifo or reading a large file. When
opening fifo or large file in a new buffer, it shows that a new buffer has been
opened instead of just hanging on the previous buffer. And if the window is
resized while waiting for ^C, the titlebar and edit window are automatically
updated, so the patch makes it consistent.
> I was looking at how to unify this, but
> then noticed another buglet [1] which I cannot get to work right:
> always one of the cases messes up the state of the terminal.
>
> [1] https://savannah.gnu.org/bugs/?56310
I'll take a look at it.
> This works fine for me: nano stores the cursor position also for a
> fifo.
Oops, I was testing with -I...
> when the user knows that the data can differ from one run to the
> next, they could use +1 before the fifo's name to force a reliable
> cursor position.
I agree.
0003-files-add-cancel-option-while-reading-an-empty-FIFO.patch
Description: Text Data
0004-files-change-titlebar-and-clear-edit-window-when-opening-a-new-buffer.patch
Description: Text Data
- [Nano-devel] [PATCH 1/2] files: allow a given file to be a special file but not a directory, Benno Schulenberg, 2019/05/12
- [Nano-devel] [PATCH 2/2] files: check for writability by the access bits, not by trying to append, Benno Schulenberg, 2019/05/12
- [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before blocking on it, Brand Huntsman, 2019/05/14
- Re: [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before blocking on it, Benno Schulenberg, 2019/05/15
- Re: [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before blocking on it, Brand Huntsman, 2019/05/15
- Re: [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before blocking on it, Benno Schulenberg, 2019/05/16
- Re: [Nano-devel] [PATCH 3/3] files: check for an empty FIFO before blocking on it,
Brand Huntsman <=
- [Nano-devel] interrupting an open() does not work with gcc, Benno Schulenberg, 2019/05/23
- Re: [Nano-devel] interrupting an open() does not work with gcc, Benno Schulenberg, 2019/05/23
- Re: [Nano-devel] interrupting an open() does not work with gcc, Brand Huntsman, 2019/05/23
- Re: [Nano-devel] interrupting an open() does work with gcc when flags are zeroed, Benno Schulenberg, 2019/05/23