bugGNU nano - Bugs: bug #44013, reading stdin causes 'Received...

 
 

bug #44013: reading stdin causes 'Received SIGHUP or SIGTERM'

Submitted by:  Cody A. Taylor <code_m>
Submitted on:  Thu 15 Jan 2015 03:51:58 PM UTC  
 
Severity: 3 - NormalStatus: Wont Fix
Assigned to: NoneOpen/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 20 Mar 2015 10:52:25 AM UTC, comment #2:

As far as I understand pipes, when you do 'echo foo | nano', you connect nano's keyboard to whatever comes through the pipe. When the input side of the pipe terminates, it sends a SIGHUP to the other side, which will terminate nano. So this is expected behaviour.

If you want to use nano as a pager, then you have to use 'nano -', as you have found out. Then nano reads whatever comes through the pipe as if it were a normal file, and at EOF reconnects the keyboard to stdin. Somehow, in the transformation of the pipe to a file, the SIGHUP gets eaten by the shell or something.

So I think this is not a bug.

Benno Schulenberg <bens>
Project Administrator
Tue 17 Mar 2015 09:37:41 PM UTC, comment #1:

I've found that if I specify stdin as file it will read fine without crashing.

Such that `svn di -r 5103:5104 | nano` does crash, and `svn di -r 5103:5104 | nano -` does not crash.

Cody A. Taylor <code_m>
Thu 15 Jan 2015 03:51:58 PM UTC, original submission:

Nano crashed while trying to use it as a pager for a diff input.

The command I used was (n is aliased to nano):
`svn di -r 5103:5104 | n --syntax=patch --tabsize=8`

I've attached a tar.gz containing:
1. gnu-screen hardcopy of the crash.
2. My .nanorc
3. Output of `nano --version`

Cody A. Taylor <code_m>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #32836:  nano-stdin-crash.tar.gz added by code_m (4KiB - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by code_m (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 25 Apr 2015 07:13:50 PM UTCbensOpen/ClosedOpen=>Closed
    Fri 20 Mar 2015 10:52:25 AM UTCbensStatusNone=>Wont Fix
      Summarystdin read caused \'Received SIGHUP or SIGTERM\'.=>reading stdin causes 'Received SIGHUP or SIGTERM'
    Thu 15 Jan 2015 03:51:58 PM UTCcode_mAttached File-=>Added nano-stdin-crash.tar.gz, #32836

    Back to the top


    Powered by Savane 3.1-cleanup1