2

I want to make Octave work only in terminal mode and options like

  • --no-gui
  • --no-window-system
  • -W

don't help me avoid ginput() command.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Ugnius Malūkas
  • 2,649
  • 7
  • 29
  • 42
  • What do you aim to archive with this? "only in terminal mode" also is without X display so no FLTK or gnuplot figures? – Andy Jan 04 '15 at 10:09

1 Answers1

2

You can overload ginput at the beginning of the octave session (in your .octaverc file for instance)

ginput = @() warning("ginput has been disabled")

This is defining a new function with the same name. The original ginput will "screened" by this new function. But a clear ginput would get rid of the new definition. Then a new call to ginput would search for it in memory (where it is not anymore), then in the path. It will eventually find the original one.

If you control the installation of octave on your customer's machine, just get rid of ginput.m file.

ederag
  • 2,409
  • 25
  • 49
  • that will not work if the user really wants to call `ginput()`. This is because `ginput()` is an m file so the user will always be able to reimplement it by copy-paste of the function (and Octave allows to define functions at the interpreter). – carandraug Feb 13 '15 at 11:29
  • @carandraug Sure. And the `clear ginput` mentionned in the answer is an even simpler way of getting `ginput` back. It seems that the OP just wanted to avoid users issuing `ginput` by mistake. – ederag Feb 13 '15 at 19:25