DEV Community

Cover image for Terminal message: "bash: syntax error near unexpected token '&' in Visual Studio Code"
Koen (K.W.H.J.) van der Kamp
Koen (K.W.H.J.) van der Kamp

Posted on

Terminal message: "bash: syntax error near unexpected token '&' in Visual Studio Code"

The reason you arrived at this page, is caused very likely, you are hampered by the fact, Visual Studio Code surprised you with a message, such as mentioned in the title; ...unexpected token '&' in Visual Studio Code... .

Why?

Most likely, you are not aware of the fact (as I was due to upgrading to python 3.9.5 64-bit) that the setting terminal.integrated.shell.windows has been deprecated. It seems it has been replaced by terminal.integrated.automationShell.windows.

How to fix!

Pick up your path to your favorite terminal and map it to terminal.integrated.automationShell.windows like
setting in settings.json

Result

three ways of script execution

PS: It it always a wise idea to recheck your environment variables if they are set to your desired python version. For what ever reason they still might point to a previous one.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay