1

My vsCode is always on auto save mode The problem I'm having is that with every minor change in the code, vsCode loses focus and the page is redirected to the browser to display the output Please help if anyone has encountered this problem Thanks.

I didn't find any solution because this problem happened to me all of a sudden.

1
  • You must have some extension or tool (like Gulp, etc.) that is reloading your browser on file saves. Look for those. Commented Sep 15 at 16:15

3 Answers 3

1

enter image description here

I found the solution I was using reactJs vite in my project and because it had hot reload and every change would refresh the localhost page in the browser and the translator popup would open in the default browser and I didn't pay attention to it, the autofocus would go to the browser because of the browser translator popup.

Sign up to request clarification or add additional context in comments.

Comments

0

if it had happened suddenly, it might be due to recent update or new extension in VS code. Try disabling extension temporarily and launch VS Code without extensions to confirm.

code --disable-extensions

Comments

0

Configure Auto Save behavior:

Open settings.json (Ctrl + Shift + P then, Preferences: Open Settings (JSON)) and set:

"files.autoSave": "onWindowChange"
"files.autoSave": "off"

With onWindowChange way, VS Code saves only when you switch windows, not on every keystroke. On the other side, with "files.autoSave": "off" way, you have to press Ctrl + S for saving.

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.