A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
This might be caused by a difference in how the terminal handles interactive input, rather than a different WSL distro, Linux user, or password. VS Code's integrated terminal is not necessarily behaving identically to the Windows Terminal session, even though both connect to the same WSL environment. In particular, password prompts can be affected by terminal settings, shell configuration, how the terminal was launched, or whether the process has access to a proper TTY.
Since you say this happens with any command requiring password authentication, I'd start by checking whether sudo can correctly read interactive input from the VS Code terminal.
- Compare the two terminals
Run these commands in both the working Windows Terminal and the failing VS Code terminal:
whoami
id
tty
echo "$SHELL"
echo "$TERM"
stty -a
Focus on tty. Both should report a valid terminal device, such as /dev/pts/0 or /dev/pts/1. The numbers do not have to match.
- Test sudo authentication independently
In the VS Code terminal, run:
sudo -k
sudo -v
sudo -k clears the cached authentication, forcing the next sudo command to request your password. sudo -v tests authentication without actually installing anything.
Type the password manually rather than pasting it.
- Check keyboard input
If the password contains special characters, test whether the keyboard layout or character input differs between Windows Terminal and VS Code. Linux does not display anything when you type a password, not even asterisks, so it is easy to miss an input problem.
- Check how VS Code was launched
If you normally launch VS Code from Windows, try launching it directly from the working WSL terminal:
cd /path/to/your/project
code .
This should help identify whether the issue relates to how VS Code initializes its WSL environment.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin