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

Input command not working in MATLAB extension for Visual Studio Code #144

Open
perfect-quinquennium opened this issue May 17, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@perfect-quinquennium
Copy link

Describe the bug
The input command in the MATLAB extension for Visual Studio Code is not working, and as a result, all functions and scripts that require user input do not function as expected.

To Reproduce

  1. Open a MATLAB script in Visual Studio Code.
  2. Add the following code to the script:
  3. Enter the following
    withdrawal = input("Enter the amount you'd like to withdraw\n> "); fprintf("You want to withdraw %d", withdrawal)
  4. Run the script using the MATLAB extension.

Expected behavior
The script should display the prompt message "Enter the amount you'd like to withdraw" and wait for the user to input a value. It should then print the entered value.

Screenshots
When running the script, the cursor blinks but nothing happens when the user enters a value and presses Enter. When the user presses Ctrl+C to terminate the program, the following error is displayed:

Screenshot (90)

Useful Information

  • OS Version: Windows 11 Version 23H2 (OS Build 22631.3447
  • VS Code Version: April 2024 (version 1.89)

Additional context
Cursor blinks also when you enter input command directly into the command prompt:
Screenshot (91)

@perfect-quinquennium perfect-quinquennium added the bug Something isn't working label May 17, 2024
@philipb314
Copy link
Member

Thank you for reporting this issue. This is something I can reproduce. As of right now interactive command window workflows such as input, more, pause, etc. are not supported by the extension. However, this is definitely something that we will be working on resolving in a coming release.

@perfect-quinquennium
Copy link
Author

Thank you for acknowledging the issue and confirming that it can be reproduced. I'm glad to hear that you're actively working on resolving the lack of support for interactive command window workflows in the extension. I look forward to the forthcoming release that addresses this limitation. If there are any workarounds or updates in the meantime, please keep me informed. Thank you for your attention to this matter.

@jlw154
Copy link

jlw154 commented May 29, 2024

On macOS Ctrl+C doesn't seem to be captured when it's waiting for pause/input. The only way I've found to interrupt it is to look up the process and issue an interrupt ("ps -ef | grep -i matlab" to find the pid, and "kill -2 pid" to send the interrupt signal).

@AtmosphericIgnition
Copy link

Hi, I spent quite some time trying to figure out why my script is not running, only to discover from this Github page that input functions are not supported. Would you mind adding something that prints an error into the Matlab terminal that the function is not supported? This would have saved me some time troubleshooting today.

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

4 participants