[Top][All Lists]

[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

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]

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.

Attachment: 0003-files-add-cancel-option-while-reading-an-empty-FIFO.patch
Description: Text Data

Attachment: 0004-files-change-titlebar-and-clear-edit-window-when-opening-a-new-buffer.patch
Description: Text Data

reply via email to

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