force console mode when matlab started with -nojvm or -nodisplay flags or octave started with --no-window-system flag (ticket 283)

time-shift
Houtan Bastani 2012-10-30 13:50:51 +01:00
parent 17568ee086
commit fc7ea133d9
1 changed files with 14 additions and 0 deletions

View File

@ -101,6 +101,20 @@ for i=2:nargin
command = [command ' ' varargin{i-1}];
end
if isempty(strfind(command, 'console'))
if exist('OCTAVE_VERSION')
if sum(get(0,'screensize'))==4
command = [command ' console'];
end
else
if isunix && (~usejava('jvm') || ...
((matlab_ver_less_than('7.5') && sum(get(0,'ScreenSize'))==4) || ...
(~matlab_ver_less_than('7.5') && ~feature('ShowFigureWindows'))))
command = [command ' console'];
end
end
end
[status, result] = system(command);
disp(result)
if status