bugGNU Octave - Bugs: bug #48017, --no-window-system command line...

 
 

bug #48017: --no-window-system command line option does not disable graphics

Submitted by:  Rik <rik5>
Submitted on:  Wed 25 May 2016 05:25:25 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Fri 27 May 2016 04:48:57 PM UTC, comment #6:

I combined our two modifications in to one cset that resolves this bug (http://hg.savannah.gnu.org/hgweb/octave/rev/58a4c5633efd). Fixed, closing report.

Rik <rik5>
Project Administrator
Wed 25 May 2016 10:33:01 PM UTC, comment #5:

Maybe the attached diff could address the gnuplot default terminal when --no-window-system is in use.

(file #37265)

Mike Miller <mtmiller>
Project Administrator
Wed 25 May 2016 07:53:35 PM UTC, comment #4:

Yeah, good point. This gets complicated quickly. I think you're right that it should launch the cli executable, which unfortunately means handling a subset of options twice like this.

After I run octave-cli --no-window-system, I get the following

so the display_info looks to be initialized correctly there. I don't know why the size vector is all 1s instead of 0s, but it is correctly not returning my actual display size.

Mike Miller <mtmiller>
Project Administrator
Wed 25 May 2016 06:11:55 PM UTC, comment #3:

Attached is a patch which fixes up main.in.cc to handle the -W option. This is a first step. The octave-cli is now called correctly and the graphics_toolkit is set to gnuplot. But it still thinks there is a display available because it is not producing ascii art.

(file #37262)

Rik <rik5>
Project Administrator
Wed 25 May 2016 05:57:05 PM UTC, comment #2:

Our startup mechanism is so convoluted now that I'm not always sure what is going on.

I see in src/main.cc the following:

For starters, I think if a user explicitly sets the --no-window-system option then they don't need to be warned about the lack of a graphical display. This suggests that the following code needs to be extended to include "--no-window-system" and "-W".

Second,

Is this call made before, or after, the call to no_window_system()? If it is made before then it will screw things up.

Rik <rik5>
Project Administrator
Wed 25 May 2016 05:34:52 PM UTC, comment #1:

The option does avoid some things, but not everything. I agree it could be used to do more.

Here's what it does

  • prevent starting the GUI
  • prevent trying to initialize $DISPLAY
  • set up the display_info class so that height, width, dpi all return 0, and display_available returns false

The problem seems to lie in that display_info::display_available should be used in more places.

Making Octave remove DISPLAY from its environment might be one way to go, but I usually dislike modifying the user's environment unless it's absolutely necessary.

Mike Miller <mtmiller>
Project Administrator
Wed 25 May 2016 05:25:25 PM UTC, original submission:

The --no-window-system or -W argument is supposed to disable any Octave features which need a graphical display. However, the following works

Octave can be forced to believe there in no display if you remove the X11 DISPLAY variable from the environment.

The plot is now made only on the console using ASCII art.

This seems to be a problem with input option processing. In octave.cc there is this line

In display.h there is this

My guess is that the order of initialization in octave.cc is now calling something that creates an instance of the display with a value of true before this is called.

Rik <rik5>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #37265:  gnuterm.diff added by mtmiller (455B - text/x-diff)
file #37262:  main.diff added by rik5 (912B - application/x-download)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (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 project members 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
    Tue 31 May 2016 09:12:38 PM UTCrik5Open/ClosedOpen=>Closed
    Fri 27 May 2016 04:48:57 PM UTCrik5StatusConfirmed=>Fixed
    Wed 25 May 2016 10:33:01 PM UTCmtmillerAttached File-=>Added gnuterm.diff, #37265
    Wed 25 May 2016 06:11:55 PM UTCrik5Attached File-=>Added main.diff, #37262

    Back to the top


    Powered by Savane 3.1-cleanup1