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

No Debug Terminal appears when starting debug #163

Open
ivavid opened this issue Feb 11, 2022 · 2 comments
Open

No Debug Terminal appears when starting debug #163

ivavid opened this issue Feb 11, 2022 · 2 comments

Comments

@ivavid
Copy link

ivavid commented Feb 11, 2022

Executables

Bash debug: 0.3.9
vscode: 1.65-insider
OS: Windows 10

PS C:\Users\user123> where bash
PS C:\Users\user123> # if `code` not found on macOS, follow the instructions in:
PS C:\Users\user123> # https://code.visualstudio.com/docs/setup/mac
PS C:\Users\user123> code --version
code: The term 'code' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\user123> bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Linux MMO-TO6735-1 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
---
/usr/bin/bash
/bin/bash
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
/bin/bash: bashdb: command not found
---
/usr/bin/cat
/bin/cat
cat (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund and Richard M. Stallman.
---
/usr/bin/mkfifo
/bin/mkfifo
mkfifo (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
---
/usr/bin/pkill
/bin/pkill
pkill from procps-ng 3.3.16

Debug output

No debug output. My launch.json is as follows:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "bashdb",
            "request": "launch",
            "name": "Bash-Debug",
            "cwd": "${workspaceFolder}",
            "program": "${file}",
            "args": [],
            "showDebugOutput": true,
            "trace": true
        }
    ]
}

Details

Debugging the following program opens no Debug Console terminal and renders no output in any terminal, as in the example gif. There is output in the Debug Console, but entering a number there for the program to read does nothing.

#!/bin/bash

echo "Enter a number."
read -r number

I've tried setting the attribute console to the different settings as listed on the vscode Debug page, to no avail.

Expected behaviour: The Debug Console terminal appears as in the example gif, and output and input from the debugged program appears there.

@ivavid ivavid changed the title No input handling in terminal, and no terminal output.l No Debug Terminal appears when starting debug Feb 11, 2022
@donghx1
Copy link

donghx1 commented Dec 11, 2022

I have same questions and looking forward to the answer.

@eduardolucioac
Copy link

eduardolucioac commented Feb 17, 2023

Add "terminalKind": "integrated" to your ".vscode/launch.json"...

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Bash: my_script",
            "type": "bashdb",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "program": "${workspaceFolder}/my_script.bash",
            "args": [],
            "terminalKind": "integrated" // The "integrated" configuration is mandatory for debugging with stdin!
        }
    ]
}

Now, you can use read -r number! 😎

[Ref(s).: https://askubuntu.com/a/1308644/134723 , https://git.artcode.re/pvincent/debian-bash/commit/a23ddb62728a5daccdb386d47258e33ca112dc26 ]

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

3 participants