vscode-bash-debug: Error: Only bash versions 4.* are supported
In addition to the details for issue, please provide us Executables information and Debug output unless you have confidence that they don’t help us.
Executables
Version of bash-debug: (can be checked in: ctrl+shift+X or command+shift+X -> INSTALLED: Bash Debug)
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
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'
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:
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash Debug",
"program": "${workspaceFolder}/src/foo.sh",
"showDebugOutput": true,
"trace": true
}
]
}
Details
Details goes here.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 2
- Comments: 16 (3 by maintainers)
It’s ludicrous to not be downstream compatible with bash version 3. Please find a way to fix the debugger for bash 3 instead of taking the easy way out and thereby excluding a large number of people from using the tool.
This isn’t a ZSH issue, though. The issue is in how the BASH version is detected. I write bash-compliant scripts and execute them using bash. I use ZSH for my interactive shell only, not as a script executor. If this extension detected bash via the binary instead of the environment, it would find a valid version of bash which it could then use.
Same problem on Mac,
brew install bashto insatll latest bash, quit VS Code and reopen to make it find the latest bash.I’m also having this problem, on Windows 10 x64 using WSL.
If I execute the requested command, Unsupported is returned. If I execute only
echo "$BASH_VERSION"then nothing is returned. In my use case, I have determined this is caused by the fact that my login shell is not bash, but zsh. As such, $BASH_VERSION is not set when this extension tries to check the variable. Perhaps a query against the bash binary instead?After playing around with several settings, I finally got this to work by specifying the path to the right version of bash in the launch settings:
... "request": "launch", "name": "Bash-Debug", "pathBash": "/usr/local/bin/bash", "cwd": "${workspaceFolder}",...note, i too have 5.1.16(1)-release as my primary bash version as applied via homebrew and set via my dotfiles makefile to append to /private/etc/shells then chsh to set as primary. There might be a few other steps that could be taken. Maybe if i put the /usr/local/bin/bash path at the top of the shells file instead of bottom? …anyway, i have my workaround. i just have to remember to apply it to every bashdebug launch config