visidata icon indicating copy to clipboard operation
visidata copied to clipboard

[vdrepl] Merge vdrepl plugin into VisiData

Open frosencrantz opened this issue 8 months ago • 3 comments

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)

frosencrantz avatar Apr 27 '25 22:04 frosencrantz

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.

saulpw avatar May 25 '25 22:05 saulpw

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.

justin2004 avatar May 26 '25 15:05 justin2004

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.

frosencrantz avatar May 29 '25 12:05 frosencrantz