bugGNU nano - Bugs: bug #63109, piping text from stdin hangs when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #63109: piping text from stdin hangs when no dash is given

Submitter:  Benno Schulenberg <bens>
Submitted:  Mon 26 Sep 2022 01:23:32 PM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Tue 27 Sep 2022 10:42:47 AM UTC, comment #3: 

Fixed in git, commit 8d7b716e, by dying when the input is not a TTY (after all command-line arguments have been processed).

Benno Schulenberg <bens>
Group administrator
Tue 27 Sep 2022 09:48:31 AM UTC, comment #2: 

The disadvantage of bailing out when standard input is still a pipe after processing all command-line arguments, is that one cannot script an operation any more, like this:

printf "<commandcodes>\x18" | nano --saveonexit somefile

However, Vim and Emacs cannot handle this usage either, so...

Benno Schulenberg <bens>
Group administrator
Mon 26 Sep 2022 01:35:32 PM UTC, comment #1: 

The hanging problem exists since version 5.9, commit 8d1a666d: "give up on the input stream only after millions of errors".

The dumping-the-buffer problem, however, has existed since before version 2.0.6.

Benno Schulenberg <bens>
Group administrator
Mon 26 Sep 2022 01:23:32 PM UTC, original submission:  

To reproduce, run

cat README | src/nano --ignore

See that text appears onscreen as if it is typed very quickly at the keyboard, and after the README is all there, nano hangs: typing at the keyboard does nothing.  See that on the status bar it says: "[ Justified paragraph ]", which is because the linefeeds in the file are seen as ^Js.

After some seconds (on a slow machine like mine more than ten seconds), nano dies with "Too many errors from stdin" and saves the buffer to an emergency file.  This is a rather poor experience.

Expected behavior: when beginning the main loop and standard input is not a terminal, nano should say so and just stop right away -- nothing should be read, nothing saved.

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-16 bens Open/ClosedOpen Closed
    2022-09-27 bens StatusIn Progress Fixed
    2022-09-26 bens StatusNone In Progress
    2022-09-26 bens Summarywhen piping text from stdin, nano hangs when no dash is given piping text from stdin hangs when no dash is given

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code