[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: Wed, 15 May 2019 19:36:53 -0600

On Wed, 15 May 2019 20:45:49 +0200
Benno Schulenberg <address@hidden> wrote:

> > This patch opens the FIFO in non-blocking mode, polls it for data
> > and re-opens it in blocking mode if data found. Just start the
> > writing process first, and then open nano.  
> I want it to be possible to open nano before the writing process has
> started. When a FIFO is used, the result shouldn't depend on the
> particular order of starting things.

What about this new patch? It allows nano to be started before the FIFO has 
data without hanging nano when someone accidentally opens a FIFO. The filename 
should probably be displayed in the prompt, but I'm out of time today. I 
originally set the filename early so it would appear in the titlebar, but that 
can't be done when inserting into an existing buffer.

Also, after reading a FIFO into a new buffer, the cursor remains at top of 
buffer. But the cursor moves to bottom of data when inserting a FIFO into an 
existing buffer. I assume it treats the FIFO as a file and opening normal files 
set cursor to top. Normal files save the cursor position when closing, but 
FIFOs don't. A FIFO could be used to open an encrypted file, and position 
history would be nice for that. Should FIFOs support position history or should 
they move cursor to bottom like reading from stdin does?

  terminal 1: mkfifo fifo ; nano fifo
  terminal 2: echo 1 >> fifo
  terminal 1: ^R to insert fifo into buffer
  terminal 2: echo 2 >> fifo

Attachment: 0003-files-prompt-before-blocking-on-an-empty-FIFO.patch
Description: Text Data

reply via email to

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