You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debugger (Launch debugger and attached debugger) #187
Please add the ability to debug Nushell scripts within VSCode. Would help when making large scripts to have a step debugger and be able to see the call stack, variable values, etc.
Would be great to have both an launch debugger option and an attached debugger option.
We don't have a debugger at all to start with, so this is something we'll have to work on. But I think there is interest in developing something like this with the Debug Adapter Protocol so that it can work with multiple editors.
You may want to check out the debug profile command, it is able to show you the result of elements executed within a pipeline and the exact execution steps taken, at least. Since it outputs a table it's fairly easy to analyze it however you want with the standard Nushell data manipulation commands.
Hey all — I've built a working DAP debugger for Nushell scripts in VS Code and published an early version: dreamcode.nu-dap-vscode.
Full disclosure: it's largely "vibe coded" with an AI assistant, but guided throughout by me as a developer — I drove the design, tested against real scripts, and steered the fixes, so the architecture and decisions are deliberate even where the code was AI-generated. It's a debug adapter that embeds Nushell as a library (using nu-protocol, nu-engine, nu-parser, and nu-command) and implements the Debugger trait, so it runs your script under eval_block:: and hooks each instruction. You get breakpoints (conditional + logpoints), step over/into/out — including stepping through pipeline stages — an exception view, variable inspection with visualizers for tables/records/binary/JSON, watch expressions, and input/input list surfaced as native VS Code pickers.
It's genuinely early and rough around the edges, so treat it as a preview. The biggest limitation is upstream: the Debugger trait callbacks don't receive the Stack, so I reconstruct variable values indirectly by watching IR instructions — which works, but blocks features like editing variables while paused, seeing closure parameters, and inspecting stream values without consuming them. A couple of small trait changes on the Nushell side (passing &Stack into the callbacks, and a control-flow return from enter_instruction for jump-to-cursor) would remove most of these workarounds and make the experience much better.
Would love feedback, and I'm happy to discuss the upstream changes if there's interest from the core team.
@rvhelden That sounds cool. I've always wanted a nushell debugger added to the extension. Ya, feel free to propose your changes on Discord in the #design-discussions channel. I'm sure we'd welcome small changes.
I was already started to integrate my vscode debugger directly into this vscode extension instead of a separate extension, was waiting on the 116 release. Hopefully I can open a PR next weekend
Activity
devyn commentedon Jul 26, 2024
We don't have a debugger at all to start with, so this is something we'll have to work on. But I think there is interest in developing something like this with the Debug Adapter Protocol so that it can work with multiple editors.
devyn commentedon Jul 26, 2024
You may want to check out the
debug profilecommand, it is able to show you the result of elements executed within a pipeline and the exact execution steps taken, at least. Since it outputs a table it's fairly easy to analyze it however you want with the standard Nushell data manipulation commands.fdncred commentedon Jul 26, 2024
You can also find commands that help with debugging by running this command below.
rvhelden commentedon Jul 24, 2026
Hey all — I've built a working DAP debugger for Nushell scripts in VS Code and published an early version: dreamcode.nu-dap-vscode.
Full disclosure: it's largely "vibe coded" with an AI assistant, but guided throughout by me as a developer — I drove the design, tested against real scripts, and steered the fixes, so the architecture and decisions are deliberate even where the code was AI-generated. It's a debug adapter that embeds Nushell as a library (using nu-protocol, nu-engine, nu-parser, and nu-command) and implements the Debugger trait, so it runs your script under eval_block:: and hooks each instruction. You get breakpoints (conditional + logpoints), step over/into/out — including stepping through pipeline stages — an exception view, variable inspection with visualizers for tables/records/binary/JSON, watch expressions, and input/input list surfaced as native VS Code pickers.
It's genuinely early and rough around the edges, so treat it as a preview. The biggest limitation is upstream: the Debugger trait callbacks don't receive the Stack, so I reconstruct variable values indirectly by watching IR instructions — which works, but blocks features like editing variables while paused, seeing closure parameters, and inspecting stream values without consuming them. A couple of small trait changes on the Nushell side (passing &Stack into the callbacks, and a control-flow return from enter_instruction for jump-to-cursor) would remove most of these workarounds and make the experience much better.
Would love feedback, and I'm happy to discuss the upstream changes if there's interest from the core team.
fdncred commentedon Jul 24, 2026
@rvhelden That sounds cool. I've always wanted a nushell debugger added to the extension. Ya, feel free to propose your changes on Discord in the #design-discussions channel. I'm sure we'd welcome small changes.
jokeyrhyme commentedon Sep 28, 2026
looks like nushell 0.116 includes @rvhelden 's
nu --daphttps://www.nushell.sh/blog/2026-09-26-nushell_v0_116_0.html#nu-dap-starts-a-debug-adapter-protocol-server-for-nushell-scripts
nushell/nushell#18738
great progress! <3
rvhelden commentedon Sep 28, 2026
I was already started to integrate my vscode debugger directly into this vscode extension instead of a separate extension, was waiting on the 116 release. Hopefully I can open a PR next weekend
rvhelden commentedon Oct 24, 2026
@fdncred I think this one can be closed since PR #241 has merged.