DEV Community

loading...
Cover image for Terminal message: "bash: syntax error near unexpected token '&' in Visual Studio Code"

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

Koen (K.W.H.J.) van der Kamp
From the ❤️ and soul, I am 😉 a biomedical coding scientist able to 'connect'! Looking for new horizons! Got interested? Contact me!
・1 min read

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.

Discussion (0)