diff --git a/pyproject.toml b/pyproject.toml index 5615bec8..1b486d46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "jupyter-matlab-proxy" -version = "0.17.0" +version = "0.17.1" description = "MATLAB Integration for Jupyter" readme = "README.md" license = { file = "LICENSE.md" } diff --git a/src/jupyter_matlab_kernel/matlab/+jupyter/execute.m b/src/jupyter_matlab_kernel/matlab/+jupyter/execute.m index c01f8d73..31287aca 100644 --- a/src/jupyter_matlab_kernel/matlab/+jupyter/execute.m +++ b/src/jupyter_matlab_kernel/matlab/+jupyter/execute.m @@ -12,7 +12,7 @@ % of a unique Live Script. Hence, each execution request can be considered as % creating and running a new Live Script file. -% Copyright 2023-2024 The MathWorks, Inc. +% Copyright 2023-2025 The MathWorks, Inc. % Embed user MATLAB code in a try-catch block for MATLAB versions less than R2022b. % This is will disable inbuilt ErrorRecovery mechanism. Any exceptions created in @@ -47,6 +47,13 @@ hotlinksPreviousState = feature('hotlinks','off'); hotlinksCleanupObj = onCleanup(@() feature('hotlinks', hotlinksPreviousState)); +% Figures hang in MATLAB versions >= R2025a for certain workflows. The following +% workaround fixes the issue in MATLAB versions >= R2025b. +if ~isMATLABReleaseOlderThan("R2025b") + forceIndependentlyHostedFiguresProp = addprop(groot, "ForceIndependentlyHostedFigures"); + propCleanupObj = onCleanup(@() delete(forceIndependentlyHostedFiguresProp)); +end + % Use the Live editor API for execution of MATLAB code and capturing the outputs resp = jsondecode(matlab.internal.editor.evaluateSynchronousRequest(request));