Skip to content

Commit 4bd6a52

Browse files
rashedmytPrabhakar Kumar
authored and
Prabhakar Kumar
committed
Fixes "Error on flush" shown in R2023a on Windows
fixes mathworks/jupyter-matlab-proxy#54
1 parent eb82746 commit 4bd6a52

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

matlab_proxy/settings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,19 @@ def get_matlab_settings():
294294
)
295295
matlab_lic_mode = ["-licmode", "file"] if nlm_conn_str else ""
296296
# flag to hide MATLAB Window
297-
flag_to_hide_desktop = "-noDisplayDesktop" if system.is_windows() else "-nodesktop"
297+
flag_to_hide_desktop = (
298+
["-noDisplayDesktop", "-wait", "-log"]
299+
if system.is_windows()
300+
else ["-nodesktop"]
301+
)
298302
matlab_startup_file = str(Path(__file__).resolve().parent / "matlab" / "startup.m")
299303
return {
300304
"matlab_path": matlab_root_path,
301305
"matlab_version": get_matlab_version(matlab_root_path),
302306
"matlab_cmd": [
303307
matlab_executable_path,
304308
"-nosplash",
305-
flag_to_hide_desktop,
309+
*flag_to_hide_desktop,
306310
"-softwareopengl",
307311
*matlab_lic_mode,
308312
"-r",

matlab_proxy/util/windows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The MathWorks, Inc.
1+
# Copyright 2022-2023 The MathWorks, Inc.
22
import asyncio
33

44
from matlab_proxy import util
@@ -49,6 +49,7 @@ async def start_matlab(matlab_cmd, matlab_env):
4949
intermediate_proc = await asyncio.create_subprocess_exec(
5050
*matlab_cmd,
5151
env=matlab_env,
52+
stdout=asyncio.subprocess.PIPE,
5253
stderr=asyncio.subprocess.STDOUT,
5354
)
5455

0 commit comments

Comments
 (0)