#tui #command-line #debugging-tool #awk #command-line-tool

app desed

Sed script debugger. Debug and demystify your sed scripts with TUI debugger.

9 stable releases

1.2.2 Oct 15, 2024
1.2.1 Oct 14, 2022
1.2.0 Oct 1, 2020
1.1.4 Apr 23, 2020

#57 in Debugging

Download history 7/week @ 2024-07-15 74/week @ 2024-07-29 14/week @ 2024-08-05 10/week @ 2024-08-12 11/week @ 2024-08-19 8/week @ 2024-08-26 50/week @ 2024-09-02 13/week @ 2024-09-09 11/week @ 2024-09-16 30/week @ 2024-09-23 15/week @ 2024-09-30 20/week @ 2024-10-07 191/week @ 2024-10-14 19/week @ 2024-10-21 20/week @ 2024-10-28

251 downloads per month

GPL-3.0-or-later

1.5MB
1.5K SLoC

Desed

Demystify and debug your sed scripts, from comfort of your terminal.

desed usage example

Desed is a command line tool with beautiful TUI that provides users with comfortable interface and practical debugger, used to step through complex sed scripts.

Some of the notable features include:

  • Preview variable values, both of them!
  • See how will a substitute command affect pattern space before it runs
  • Step through sed script - both forward and backwards!
  • Place breakpoints and examine program state
  • Hot reload and see what changes as you edit source code
  • Its name is a palindrome

Install

Alpine Linux

aports/testing/desed

Arch Linux

Via AUR: desed-git or desed as stable version.

DragonFly BSD

pkg install desed

Fedora

dnf install desed

FreeBSD

pkg install desed

Void Linux

xbps-install -S desed

Source

git clone https://github.com/soptikha2/desed
cd desed
cargo install --path .
cp "desed.1" "$(manpath | cut -d':' -f1)/man1"

Cargo

cargo install desed

Precompiled binaries

See releases.

Dependencies:

Development: rust, cargo (>= 1.38.0)

Runtime: sed (GNU version, >= 4.6) (desed works on BSD if you installed gsed)

Controls

  • Mouse scroll to scroll through source code, click on line to toggle breakpoint
  • j, k, g, G, just as in Vim. Prefixing with numbers works too.
  • b to toggle breakpoint (prefix with number to toggle breakpoint on target line)
  • s to step forward, a to step backwards
  • r to run to next breakpoint or end of script, R to do the same but backwards
  • l to instantly reload code and continue debugging in the exactly same place as before
  • q to quit

FAQ

How does it work?

GNU sed actually provides pretty useful debugging interface, try it yourself with --debug flag. However the interface is not interactive and I wanted something closer to traditional debugger. I've written something here.

Does it really work?

Depends. Sed actually doesn't tell me which line number is it currently executing, so I have to emulate parts of sed to guess that. Which might not be bulletproof. But it certainly worked good enough to debug tetris without issues.

Why sed??

Sed is the perfect programming language, especially for graph problems. It's plain and simple and doesn't clutter your screen with useless identifiers like if, for, while, or int. Furthermore since it doesn't have things like numbers, it's very simple to use.

But why?

I wanted to program in sed but it lacked good tooling up to this point, so I had to do something about it.

Why?

Because it's the standard stream editor for filtering and transforming text. And someone wrote tetris in it!

What is the roadmap for future updates?

I would like to introduce syntax highlighting and add this tool to standard repositories of all major distributions.

Is this a joke?

I thought it was. But apparently it's actually useful for some people.

Other projects

  • video summarizer, a tool and browser extensions that determines if people in video are currently talking or not, and speeds up the video accordingly. Great for long lecture videos for skipping time spent writing on a whiteboard.

Dependencies

~8–17MB
~248K SLoC