feh icon indicating copy to clipboard operation
feh copied to clipboard

feh modifies a passed filelist

Open kiteloopdesign opened this issue 2 years ago • 5 comments
trafficstars

when passing a file with "-f" option in which the images are not listed as expected (one per line), feh decides to delete these files from the list

This is highly unexpected and dangerous behaviour, no tool should do this w/o confirmation or an extra switch (eg --edit)

kiteloopdesign avatar Mar 10 '23 08:03 kiteloopdesign

This is the behaviour that is described in the man page.

Any changes to the internal filelist (such as deleting a file or it being pruned for being unloadable) will be saved to file when feh exits. You can add files to filelists by specifying them on the command line when also specifying the list.

avlec avatar Mar 12 '23 06:03 avlec

Indeed, though this issue makes me question whether this is sensible behaviour. I can understand that users would expect a filelist to remain unchanged unless they perform explicit actions to alter it.

I'll flag this as a bug for now and see how I can improve this.

derf avatar Mar 12 '23 09:03 derf

One option that comes to mind that preserves existing behaviour is to chmod the file to remove write access. However, I am not sure that would be an acceptable solution

avlec avatar Mar 13 '23 00:03 avlec

derf, avlec, thanks for the answers

IMHO, it's not a sensible behaviour for any tool to alter a file in this way. Even more being the case of a filelist, which is just a means of providing the images to feh. This is, a user may expect an image browser/editor to make changes to the images, but not to a filelist.

Not sure why you provide this behaviour that avlec quoted on his reply, but, if you want to maintain it, I would suggest to break out the -f in two different options. That or I would require a new "--allowlistedit" flag

kiteloopdesign avatar Mar 13 '23 09:03 kiteloopdesign