Matlab-Code-Run-for-VS-Code icon indicating copy to clipboard operation
Matlab-Code-Run-for-VS-Code copied to clipboard

[Windows] Console problems

Open ktomczyk opened this issue 6 years ago • 5 comments

I tested it on Windows 8.1 and it's working somehow. However there are 2 issues:

  • instead of displaying the text output in VS Code build-in console, it launches a new window called MATLAB Command Window and displays it here (like shown on the attached file)
  • there's no other way I found to change the working directory than close VS Code and reopen the file I want to set the working directory in, if I try to run a different file (even in the same directory), it calls the wrong command and fails (I suppose it's partially because of the first issue - it's trying to execute run command in VS console while it works only in MATLAB cons ole)

Both issues are shown on the screenshot. issues

ktomczyk avatar Apr 05 '19 16:04 ktomczyk

First of all, thank you for testing it on Windows! Your info is incredibly helpful.

Your results are in line with what I expected. The command prompt you are seeing is a Matlab window and not the actual DOS or Powershell terminal. In contrast with MacOS and Linux, this window is what Matlab always uses on Windows unfortunately.

I am looking into using a COM automation server, but unfortunately, this is a really old feature in Windows and Matlab and I am having some difficulties with it.

For now, it is nice that you can kinda run it in Windows I guess. But I hope to find a solution as soon as possible!

bramvbilsen avatar Apr 05 '19 18:04 bramvbilsen

Same question! A new window appears 🤣🤣 I tested it on Windows 10

lyyc199586 avatar May 23 '19 09:05 lyyc199586

@lyyc199586 That is to be expected as Matlab uses its own java based console on windows, instead of using cmd/powershell. I have some ideas to get around this, but have not found the time to implement it yet.

bramvbilsen avatar May 23 '19 11:05 bramvbilsen

@lyyc199586 A quick fix is to simply type exit() whenever you've seen the output etc..

Uzaaft avatar Oct 16 '19 05:10 Uzaaft

This is by itself not a so big problem, it even has the pro to be an interactive console! However, once a script has been launched once, it is not possible to relaunch it through the extension without restarting everything, as the extension will only execute a run command. The solution would be to always call matlab -nosplash -nodesktop on Windows I guess.

apommel avatar Jan 09 '20 13:01 apommel