VS Code Zsh Debug
A zsh debugger GUI frontend based on awesome zshdb scripts (zshdb included in package).
Overview
This is a SIMPLE zshdb debugger frontend. Useful for learning zsh shell usage and writing simple scripts.
Useful hint: shellcheck extension does a great job with finding common script errors before debugging.
Usage
- Select Debug -> Add Configuration to add custom debug configuration (drop-down, path-input, etc...)
- Select Debug -> Start Debugging (F5) to start debugging
See https://code.visualstudio.com/docs/editor/debugging for general usage.
Sample features
- Debugging auto-configuration via
launch.json
![Click to show in browser](https://raw.githubusercontent.com/rogalmic/vscode-zsh-debug/gif/images/zsh-debug-samp-launch-autoconfig.gif)
- Simple debugging in hello world application
![Click to show in browser](https://raw.githubusercontent.com/rogalmic/vscode-zsh-debug/gif/images/zsh-debug-samp-hello-world.gif)
- Standard input handling via terminal
![Click to show in browser](https://raw.githubusercontent.com/rogalmic/vscode-zsh-debug/gif/images/zsh-debug-samp-stdin-usage.gif)
- Pause support while script is running
![Click to show in browser](https://raw.githubusercontent.com/rogalmic/vscode-zsh-debug/gif/images/zsh-debug-samp-pause-support.gif)
- Advanced "Watch" and "Debug console" usage
![Click to show in browser](https://raw.githubusercontent.com/rogalmic/vscode-zsh-debug/gif/images/zsh-debug-samp-watch-advanced.gif)
- Conditional breakpoints usage
![Click to show in browser](https://raw.githubusercontent.com/rogalmic/vscode-zsh-debug/gif/images/zsh-debug-samp-conditional-breakpoints.gif)
For Windows users:
For macOS users:
- Read here if your mac has
/usr/local/bin/pkill .
Dependencies
zsh version 4.3.6-dev-2 or later
cat , mkfifo , rm , pkill
Limitations and known problems
- Use
terminalKind @launch.json set to integrated or external for interactive scripts (using stdin)
- Currently debugger stops at first command
$0 variable shows path to zshdb
| |