rogalmic / vscode-bash-debug

Bash shell debugger extension for VSCode (based on bashdb)
MIT License
217 stars 26 forks source link

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

Open pntasle opened 1 year ago

pntasle commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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