saulpw/visidata

shell-command-on-cell

Opened this issue · 1 comments

My mind completely blown today as I'm finally digging into the docs and tutorials and learning Visidata. Amazing tool! :-) I've been wanting for and dreaming about this for years (heavy Emacs/tmux/console user here).

I've dug around a fair bit and couldn't figure out how to run a shell command on the current cell/row in directory mode (default invocation if you just type "vd"). I'd like to run a command such as "evince" on a PDF file for example. I've seen Ctrl + O which invokes $EDITOR, but given the amazing number of features and demos I'd be really surprised if it's not always built in. I couldn't find it.

Thank you for building this tool, I'm going to write plugins

I looked at the source and indeed it seems like it's not there, that is, a command that would read a shell command as input and run it with the value of the current cell contents. The code is straightforward, I might send a PR over the weekend.

In my digging around I noticed the color_shellcmd is not used anywhere. Probably vestigial.