Code Execution Fails to Stop with CTRL+C or Terminal Kill When Printing to Terminal
Describe the bug
The execution of code does not stop when using the CTRL+C shortcut or by killing the MATLAB terminal when something is being printed to the terminal.
Steps to reproduce:
- Create an infinite loop:
while true; disp(1); end - Press
CTRL+Cto stop the process. - Kill the terminal by clicking the trashcan icon at the top of the integrated terminal window.
Expected behavior
Code execution should halt with the CTRL+C shortcut, and if that fails, it should stop when the terminal is terminated.
Useful information:
- MATLAB Version: 23.2.0.2599560 (R2023b) Update 8
-
VSCode Version: 1.93.0 (user setup)
- Commit: 4849ca9bdf9666755eb463db297b69e5385090e3
- Date: 2024-09-04
- Electron: 30.4.0
- Chromium: 124.0.6367.243
- Node.js: 20.15.1
- OS: Windows_NT x64 10.0.22631
Additional context
This behavior seems unusual. Killing the terminal does not terminate the process. For example, with an infinite loop (while true end), closing the MATLAB terminal does not stop the execution. When opening a new MATLAB terminal, the code continues to run and can only be stopped with CTRL+C. However, in cases where output is being printed to the terminal (as described), neither CTRL+C nor killing the terminal works, and reopening the terminal becomes impossible. The only way to stop the process is to terminate the entire VSCode instance via Task Manager.
Thank you for reporting this issue. This is something I can reproduce and is something that we will be working on resolving in a coming release.
The issue still seems to persist. CTRL+C does not seem to cancel any print out unfortunately.
Edit: The recent update allows me to cancel printout and commands (I'm on MacOS). Thanks a ton!! However this seems to be quite sluggish.