Skip to main content

bash-dap

A debug adapter of the Debug Adapter Protocol for bash scripts: breakpoints, steps into, over and out of functions, the call stack, the variables (arrays and associative arrays as trees), expressions, pause.

It needs nothing but bash 4.1 or newer and Python 3.8 or newer: no bashdb, no Node.js. (The bash of macOS is 3.2: a newer one, from Homebrew say, is given to the launch as bash.) The debugger itself is a script of bash, harness.sh, which the adapter runs the script under; it stops the script with the trap DEBUG, in the subshells of $(...) and of pipes too.

Install

pipx install bash-dap            # or: pip install --user bash-dap
pipx install .                   # from a clone of this repository

The command bash-dap speaks the protocol on its stdin and stdout.

Editors

coole: a script .sh or .bash gets bash-dap by itself: F6 on a line, F5.

Neovim (nvim-dap):

local dap = require("dap")
dap.adapters.bashdap = { type = "executable", command = "bash-dap" }
dap.configurations.sh = {
  { type = "bashdap", request = "launch", name = "bash-dap",
    program = "${file}", cwd = "${workspaceFolder}", args = {} },
}

Helix, Zed and the others: an adapter of type executable, command bash-dap, a request launch.

Launch

program      the script
args         its arguments
cwd          the directory it runs in
env          variables added to its environment
console      integratedTerminal (the default, when the client has runInTerminal): the script
             runs in the terminal of the client, and reads what is typed there;
             internalConsole: what it writes comes as output, it reads nothing
stopOnEntry  stop before its first command
bash         the bash to run it with

How it works

The adapter makes a directory of its own with two fifos: it writes the commands of the harness to one (run, step, next, finish, print, vars, stack) and reads its replies from the other. A subshell is a process of its own, so what is said to one, a step, a breakpoint, goes to the others through files of that directory, which every process looks at, at a test of two files a command. A script under the debugger runs some 25 times slower than by itself.

When the session ends the adapter ends the script by its process group, the session it has to itself; never by a parent, never anything else.

Not yet

Conditional breakpoints, breakpoints on functions, a script that another script runs with a new bash.

License

GPL-3.0-or-later.

Metadata

Release files for bash-dap 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bash-dap 0.1
File Size Uploaded
bash_dap-0.1.tar.gz 28.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bash-dap 0.1
File Interpreter ABI Platform
bash_dap-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 54.2 kB

Release files / bash_dap-0.1.tar.gz

Download URL bash_dap-0.1.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
68b425de0e9d91496fc942d68883429132e6a30f322191489778f5b63ae69d8b
BLAKE2b-256 checksum
How to use checksums
c44ce5b88ff7ff8312304e1d0e4669fa1c1d2dc8c8f01f2a5ba99065f3d70b93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / bash_dap-0.1-py3-none-any.whl

Download URL bash_dap-0.1-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c67331c8e51a28de44ece62a07bbe4e2244a26d00bb58cbf364ff5645db6ee09
BLAKE2b-256 checksum
How to use checksums
23cf277507bf3dd392d764945221cfb578f90526f603df989362e174ceb1958c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3

2 release files

0.2

2 release files

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page