bugPSPP - Bugs: bug #17213, interactive output should go to...

 
 

bug #17213: interactive output should go to terminal

Submitter:  Ben Pfaff <blp>
Submitted:  Thu 27 Jul 2006 05:53:58 AM UTC
   
 
Category:  Output Driver Severity:  1 - Wishlist
Status:  Fixed Assigned to:  blp
Open/Closed:  Closed Release:  Before 0.6.0
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 27 Jul 2007 11:00:04 PM UTC, comment #3: 


>Maybe it's possible for two distinct pointers to be associated
>with the same stdio stream, or perhaps it could fail after a call
>to freopen ?? I don't know.


My goal here is that if you use fn_open("-", <mode>) and thereby get a standard stream out of it, then fn_close("-", <stream>) won't close that standard stream.  What you're saying can't happen in ISO C, which doesn't allow the standard streams to be assigned to, and freopen always returns the same FILE * that it is passed.  In the GNU C library, you can actually assign new streams to stdin/out/err, so the problem could arise, but it's a bad idea to assign to them and PSPP (and gnulib) doesn't do that.

I considered using dup and fdopen to actually duplicate the standard streams instead of just trying to detect them.  But that's troublesome for another reason: we'd have to be pretty careful about calling fflush in the right places to avoid interleaving output strangely.

>Perhaps it would be better to use
> if ( fileno(f) == STDIN_FILENO || ...


I don't know why I bothered to write all the text above.  I think your solution is fine.  I'll do that.

>2. I'll assume that the HAVE_LIBTERMCAP vs. HAVE_LIBNCURSES
>change is correct.


I think it is: that code didn't do anything before and now it appears to work in testing.

Thanks!  I checked this in.

Ben Pfaff <blp>
Group administrator
Thu 26 Jul 2007 07:17:43 AM UTC, comment #2: 

1. I'm not sure how safe this is:
   if (f == stdin || f == stdout || f == stderr)

Maybe it's possible for two distinct pointers to be associated with the same stdio stream, or  perhaps it could fail after a call to freopen ?? I don't know.

Perhaps it would be better to  use
  if ( fileno(f) == STDIN_FILENO || ...


2. I'll assume that the  HAVE_LIBTERMCAP vs. HAVE_LIBNCURSES change is correct. That issue is so convoluted I always get confused.

I don't see any other problems.

John Darrington <jmd>
Group administrator
Thu 26 Jul 2007 01:20:53 AM UTC, comment #1: 

Fix attached.  It also fixes a bunch of other bugs I discovered while in the middle of fixing it.

Also attached, a bonus patch that allows the line-drawing features of VT100 terminals (and xterms) to be used in PSPP output.

(file #13472, file #13473)

Ben Pfaff <blp>
Group administrator
Thu 27 Jul 2006 05:53:58 AM UTC, original submission:  

It's rather irritating that, when PSPP is being used interactively in the textual UI, output does not go to the terminal, but only to the listing file.  (There is a setting that is supposed to control this behavior.)

Ben Pfaff <blp>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #13472:  interactive-output.patch added by blp (19KiB - text/x-diff)
file #13473:  vt100-line-draw.patch added by blp (7KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by blp (Updated 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.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-07-27 blp StatusReady for Test/Review Fixed
        Open/ClosedOpen Closed
    2007-07-26 blp Attached File- Added interactive-output.patch, #13472
        Attached File- Added vt100-line-draw.patch, #13473
        StatusNone Ready for Test/Review
    2006-07-31 blp Assigned toNone blp
    2006-07-31 blp ReleaseNone Before 0.6.0

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code