File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 11%% ISINTERACTIVE tell if being run interactively
22%
3- % NOTE: don't use batchStartupOptionUsed as it neglects the "-nodesktop" case
3+ % we try to consider the "-nodesktop" mode as interactive.
4+ % * get(0,'ScreenSize') often isn't relable anymore, it will show a display
5+ % size on HPC for example, maybe due to Xvfb or such.
6+ % Nowadays (R2025a+) one can make plots without Java enabled -nojvm too.
7+
48
59function g = isinteractive()
610
7- if stdlib .isoctave()
8- g = ~isempty(graphics_toolkit());
9- else
11+ if batchStartupOptionUsed()
12+ g = false ;
13+ elseif stdlib .is_matlab_online()
14+ g = true ;
15+ elseif isMATLABReleaseOlderThan(' R2025a' )
1016 g = usejava(' desktop' );
17+ elseif feature(' showFigureWindows' )
18+ % this is true in matlab -batch by default
19+ g = true ;
20+ else
21+ % assume true to be 'safe'
22+ g = true ;
1123end
1224
1325end
You can’t perform that action at this time.
0 commit comments