paulklemm / rvisidata

Open any dataframe with visidata, a terminal-based spreadsheet application
Other
30 stars 2 forks source link

Add optional tmux integration #3 #4

Closed strazto closed 4 years ago

strazto commented 4 years ago

This is to address issue #3 - Allow vd to be run in another pane / window if R is running from a tmux session.

The biggest change to the API is that the tempfile is no longer removed when rvisidata::vd() returns, as now the vd binary is executing asyncronously, and this cleanup without sync causes a race condition (Usually the cleanup beats vd to the punch and the file cant be opened).

I'm sure other workarounds exist, but this was simplest, and R will automatically cleanup for us when it exists anyway.

Also, instead of the return of file.remove being returned invisibly by rvisidata::vd(), now the input object is returned invisibly.

This MAY have some benefit in magrittr pipelines, but it's mainly just because you may as well return something.

paulklemm commented 4 years ago

Great contribution, Matthew, thanks!