Skip to main content

bash-dap

A debug adapter of the Debug Adapter Protocol for bash scripts: breakpoints on lines and on functions, 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.

A breakpoint on a function stops at its first command, at each call, in a subshell too; what the script defines later, or a file it sources, is found as well, as the name is all the debugger looks for.

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, a script that another script runs with a new bash.

License

GPL-3.0-or-later.

Metadata

Release files for bash-dap 0.2

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.2
File Size Uploaded
bash_dap-0.2.tar.gz 29.6 kB Details

Built distribution (wheel)

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

Total release size: 55.8 kB

Release files / bash_dap-0.2.tar.gz

Download URL bash_dap-0.2.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
886b0ccb0e2abe18f6ac37df5318ee9a05feb94977e11113af1840797eab9914
BLAKE2b-256 checksum
How to use checksums
21e869c22b71b37285241cffcaf4167039f46b132e5b89a5d3b6a2e60ef90dce
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.2-py3-none-any.whl

Download URL bash_dap-0.2-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
133e34fd9b42875f1ff04454a36c215c2a902a290939cfa53b719fd238a797f8
BLAKE2b-256 checksum
How to use checksums
f9a45e9efaffd8a2f54c6ed99be1e179759dcd5f41ff6de38ec11e7b7e9529a8
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

This release

0.2 This release

2 release files

0.1

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