windowspowershelltab-completion

Stop ampersand from being automatically prepended to directory paths dropped into VSCode console from project explorer


The "&" coming automatically

When dragging a folder from VSCode's project explorer into VSCode's console, an ampersand (&) is automatically prepended to the path, messing up the command. How can I stop this from happening? I can of course manually delete it every time, but that gets exhausting quickly.

Screen recording of the issue: https://www.loom.com/share/5f469083e1c1457ca7dd3dd95749832e


Solution

  • To prevent the automatic addition of an ampersand when dragging directory paths from the VSCode project explorer into the console, you can use quotes to enclose the directory path before the drag n drop operation TRY :

    1: select the folder you want to use in the console.

    2: Instead of simply dragging and dropping the folder, hold down the Shift key while dragging the folder into the console. This will force Windows to enclose the path in quotes thus solving the issue of automatic addition of ampersand(&).

    You should then see something like :

    PS C:\Users\webta\Downloads\Backend\2.1+Using+Node>cd "C:\Users\webta\Downloads\Backend\2.1+Using+Node"
    

    Hope it solves the problem