diff --git a/src/MATLAB.jl b/src/MATLAB.jl index 2af59ac..4dbf2aa 100644 --- a/src/MATLAB.jl +++ b/src/MATLAB.jl @@ -80,7 +80,10 @@ function __init__() if libmx_size > 0 # non-zero size library path # load libraries - + # workaround for https://github.com/JuliaInterop/MATLAB.jl/issues/200 + if Sys.iswindows() + ENV["PATH"] = string(matlab_libpath, ";", ENV["PATH"]) + end libmx[] = Libdl.dlopen(joinpath(matlab_libpath, "libmx"), Libdl.RTLD_GLOBAL) libmat[] = Libdl.dlopen(joinpath(matlab_libpath, "libmat"), Libdl.RTLD_GLOBAL) libeng[] = Libdl.dlopen(joinpath(matlab_libpath, "libeng"), Libdl.RTLD_GLOBAL) diff --git a/src/engine.jl b/src/engine.jl index 0e83b7c..f0ca5de 100644 --- a/src/engine.jl +++ b/src/engine.jl @@ -5,8 +5,8 @@ # Session open & close # ########################################################### -const default_startflag = "" # no additional flags -const default_matlabcmd = matlab_cmd * " -nosplash" +const default_startflag = "-nodisplay -nosplash -nodesktop" # no additional flags +const default_matlabcmd = matlab_cmd * " -nodisplay -nosplash -nodesktop" # pass matlab flags directly or as a Vector of flags, i.e. "-a" or ["-a", "-b", "-c"] startcmd(flag::AbstractString = default_startflag) = isempty(flag) ? default_matlabcmd : default_matlabcmd * " " * flag startcmd(flags::AbstractVector{<:AbstractString}) = isempty(flags) ? default_matlabcmd : default_matlabcmd * " " * join(flags, " ")