1

I am using Microsoft VS Code version 1.34.0 (64 bit version) on Windows 10 64 bit. I have "Python" and "Code Runner" extensions installed and using it for Python 3.7.3

I click on triangle in top right corner to run code or do Ctrl + Alt + N. When I run code that needs user input, I can see the message(if provided any in code) and cursor in Terminal but the cursor is inactive (empty rectangle). The active cursor (blinking) is still in code editor pane.

Is there any way to automatically move the active cursor from code editor to Terminal for user input?

I am trying to avoid one extra mouse click or (Ctrl + `)

2 Answers 2

2

Install Code Runner from vscode extensions

Then Add the following line in settings.json :

"code-runner.preserveFocus": false
Sign up to request clarification or add additional context in comments.

4 Comments

you forgot to mention that Code Runner extension has to be installed to use your solution - marketplace.visualstudio.com/…
I did this but when I run code, cursor disappears. Not in editor or console. I still have to click into the console to enter user input
are you sure running the code using coderunner or other extension?
It does not work. The answer is badly expressed. It should be something like "it is possible to have the code executed by a dedicated extension, which, with the right configuration, can do what is needed".
0

Search/ Filter in Settings with focus after run and select terminal instead of defaulted none in the given option:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.