vscode-bash-debug
vscode-bash-debug copied to clipboard
Initiating debug produces `stty: stdin isn't a terminal` in debug console
Running on MacOS, receive stty: stdin isn't a terminal
Executables
❯ bashdb --version bashdb, release 4.4-0.94
where bash
# if `code` not found on macOS, follow the instructions in:
# https://code.visualstudio.com/docs/setup/mac
code --version
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
❯ ci --version 1.24.0-insider 92754223624dcbe9aca0e5ca3ba8a53808b122b6 x64
Debug output
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
Unfortunately i do not have macOS to reproduce this. Please answer following questions:
- Does this fail always (for any script) ?
- Does this fail at startup, or during execution of script?
Reproduced on Ubuntu 18.04 ~~when debugging NetBSD's build.sh~~ on any script. Maybe comes from changes in latest bashdb, I'll describe details later.
Unfortunately i do not have macOS to reproduce this. Please answer following questions:
Does this fail always (for any script) ?
Yes, it fails for any and all scripts. Further, see what @rogalmic had to say (it is not on OS thing based on this report)
Does this fail at startup, or during execution of script?
Fails on startup
I tried on Windows with following bashdb:
/mnt/c/Users/rogal_000$ bashdb --version
bashdb, release 4.4-0.94
Works fine (also with mentioned build.sh
), so the problem seems to be not related only to bashdb.
git-bisecting revealed bashdb@4e1479d is the bad commit, certainly introducing the use of stty
command.
I think the author didn't consider a situation where bashdb's fd[0-2] are connected to pipes.
As a workaround, we can avoid this bug by using bashdb-4.4-0.92 or before.
Here's a screenshot:
Once debugging has started, we can't stop it nor even restarted it.
The error message stty: 'standard input': Inappropriate ioctl for device
differs from @mfour-merickson's one since they are output by stty
:
- https://opensource.apple.com/source/adv_cmds/adv_cmds-149/stty/stty.c
-
errx(1, "stdin isn't a terminal");
-
- https://github.com/coreutils/coreutils/blob/v8.28/src/stty.c#L1782
@wataash : What do you think would be correct way to fix that? Can we propose a fix to bashdb
, or vscode-bash-debug
needs refactoring?
I think we should modify launchRequestFinalize first.
Maintaining text parsing code is painful, but I think we should not request the backward compatibilities of bashdb's output. Instead, we could request machine-friendry interface like gdb -i=mi.
I hope I'll get down to this work soon... :)
I am trying to install using homebrew, without much success, is this the correct syntax (I am sure I have installed specific formulas in the past with this approach)
brew install bashdb 4.4-0.92
A related bashdb
bug report and a proposed fix with can be found in https://sourceforge.net/p/bashdb/bugs/58/.