Visidata: [develop] Saving DirSheets doesn't delete files

Created on 22 Aug 2019  Â·  4Comments  Â·  Source: saulpw/visidata

Small description
Opened a directory in Visidata, deleted a file and saved.

Expected result
File deleted from the file system

Actual result with screenshot
No result, no error.
dirsheet

Steps to reproduce with sample data and a .vd
In a terminal, open vd with vd (no args). Delete the file with d. Save with Ctrl+S

Cmdlog:

sheet   col row longname    input   keystrokes  comment
            open-file   .   o   
        ã‚­.,test.md  delete-row      d   
            save-sheet      ^S  

Additional context
VD: 2.-1dev, OS: Linux

bug

All 4 comments

OT: What are you using for your screenshots @Mikee-3000?

Peek for the recording
Screenkey for the key display
Unfortunately Peek crashes when I try to save to gif, so I save it as mp4 and use ffmpeg -i infile.mp4 outfile.gif to convert it.

Hi @Mikee-3000, thanks for reporting this bug, which points to some deeper problems with interactions between the DirSheet and deferred modifications on other sheets. I think it may not be possible to have it work well both ways: the DirSheet (and other deferred modification sheets) want deleted rows to stick around (but colored/marked deleted) until the changes are committed. But data sheets want deleted rows to disappear straightaway. So either we remove the deferred modification functionality from most sheets, like it was pre-2.0, and/or we move the DirSheet editing functionality out into its own tool (vls, maybe?). I think this might make more sense ultimately, since data sheets and filesystem editing are kind of two radically different use cases, even though you want to use many of the same data management features for both.

This is now fixed on the develop branch. We are experimenting with moving the Write-mode of the DirSheet into its own tool vls.

It does not have its own setup.py yet. To play with it, install the latest of VisiData v2.x (it is a dependency), then take the vls script and place it in a bin that is findable by PATH.

Then type vls and it should be the DirSheet that we know and love.

We are still considering how this will play out, so if anyone has any thoughts please share them! I will open up a new issue for Discussion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aborruso picture aborruso  Â·  3Comments

aborruso picture aborruso  Â·  3Comments

baogorek picture baogorek  Â·  3Comments

paulklemm picture paulklemm  Â·  4Comments

suntzuisafterU picture suntzuisafterU  Â·  3Comments