Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute startup.m / finish.m automatically #214

Open
mtaniguch opened this issue Jan 29, 2025 · 5 comments
Open

Execute startup.m / finish.m automatically #214

mtaniguch opened this issue Jan 29, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@mtaniguch
Copy link

mtaniguch commented Jan 29, 2025

Is your feature request related to a problem? Please describe.
Yes, I believe that the feature to automatically execute startup.m and finish.m scripts, similar to the MATLAB desktop environment, is not yet implemented in this extension. This is crucial for users who rely on these scripts for their workflow.

Describe the solution you'd like
I would like this extension to be enhanced to automatically execute startup.m when a MATLAB session is initiated from VSCode, and finish.m when the MATLAB session is terminated or the VSCode window is closed.

Describe alternatives you've considered
The only alternative I can think of is to manually execute these scripts via the MATLAB command line, which is not as efficient.

Additional context
In my workflow, I use finish.m to track and manage the time I spend using MATLAB.

MATLAB : 24.2.0.2773142 (R2024b) Update 2
VSCode : 1.96.4 (user setup)
OS : Windows_NT x64 10.0.22621

@mtaniguch mtaniguch added the enhancement New feature or request label Jan 29, 2025
@dklilley
Copy link
Member

Thanks for raising this suggestion!

Do you want the same startup/finish scripts to run as when you launch MATLAB normally, or are you asking for custom scripts to be run when the extension launches MATLAB?

@mtaniguch
Copy link
Author

Hi. @dklilley , thanks for the response!

In my case, I would like the same startup / finish scripts to be run as when launching MATLAB normally.

Additionally, in my environment, these scripts are located in the MATLAB PATH, and it seems that the same PATH can be referenced by the MATLAB session connected by the extension.

@dklilley
Copy link
Member

Thanks for the confirmation!

It appears that the startup script is being correctly run when MATLAB is launched, but the finish script is not being executed when MATLAB is disconnected. I will look into whether there is a different way we need to terminate the MATLAB process.

@mtaniguch
Copy link
Author

mtaniguch commented Jan 31, 2025

I see! In my environment as well, by adding questdlg, I was able to confirm that startup.m is being executed.
I didn't notice because nothing is displayed in the MATLAB command window in VSCode.
And, as you confirmed, it seems that finish.m is not being executed.

@dklilley dklilley added bug Something isn't working and removed enhancement New feature or request labels Jan 31, 2025
@dklilley
Copy link
Member

Updating to a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants