Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every time a script has a "read" command the debugger got stuck and nothing is displayed in the debug console #175

Open
pntasle opened this issue Feb 3, 2023 · 2 comments

Comments

@pntasle
Copy link

pntasle commented Feb 3, 2023

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.

@pntasle
Copy link
Author

pntasle commented Feb 7, 2023

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.

@rogalmic
Copy link
Owner

rogalmic commented Feb 7, 2023

Please use terminalKind integrated or external. Debug console does not have standard input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants