Every time a script has a "read" command the debugger got stuck and nothing is displayed in the debug console
Opened this issue · 2 comments
Test script is VS code with bash Debug extension all updated running with WSL2 on windows 11
Whatever the script every time there is a Read command in it got stuck with non error generated. I have to stop the debug manually.
Please note that if I run the script in the terminal it works just fine.
#!/bin/bash
declare -a users
while true; do
echo "Enter a username (or press q to quit): "
read username
if [ "$username" == "q" ]; then
break
fi
users+=($username)
done
echo "Users in the list:"
for user in "${users[@]}"; do
echo " $user"
done
Debug output
Enter a username (or press q to quit):
My launch.json
may looks like:
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash simple",
"cwd": "${workspaceFolder}",
"program": "${file}",
//"terminalKind": "integrated",
"terminalKind": "debugConsole",
"showDebugOutput":false,
"trace": false
}
]
}
Details
Details goes here.
I'm new to bash scripting and may ask silly questions. Please don't judge me, and if I don't get an answer, that's okay.
Please use terminalKind integrated or external. Debug console does not have standard input.