[vdrepl] Merge vdrepl plugin into VisiData
Discussion in https://github.com/saulpw/visidata/discussions/2290
Import https://github.com/ajkerrigan/visidata-plugins/blob/main/plugins/vdrepl.py
@ajkerrigan @justin2004
(filing this ticket so it is not lost)
Thanks @frosencrantz! I looked into this a bit, and it's easy enough to pull @ajkerrigan's plugin into the main repo (with its ptipython dependency), but as per the linked discussion, there are open questions about whether it's the right approach. If you and others are actively using the vdrepl plugin then we can just take it, but otherwise I'd love for us to converge on an implementation that fits best.
for a repl candidate for the main branch... do we want a failure to happen at vd start up if all the dependencies are not installed?
@ajkerrigan 's repl will fail on vd startup if ptpython is not installed (and the rest of the vd rc file will not be executed). unless the user does something like:
try:
import plugins.vdrepl
except Exception as e:
vd.status(f"Unable to load plugin `vdrepl`: {e}")
but the rlwrap approach will fail at command invocation time if rlwrap is not installed.
I have not used this plugin. My interest came from the conversation and in trying a REPL in VisiData. I was interested in trying once it was merged.