Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.57k stars 231 forks source link

extension feature problem #552

Open evanescente-ondine opened 2 years ago

evanescente-ondine commented 2 years ago

Hi, I think the extensions feature is not working well. I want to override "edit", or the shortcode "e", so that it opens $EDITOR normally, but with certain extensions losslesscut or gimp or audacity. as written down there, it only opens losslesscut regardless of extension. When I uncomment the last part, it only opens micro.

Code { invocation: edit shortcut: e external: "gimp {file}" leave_broot: false extensions: [ webp heic xcf jpg png gif bmp ] } { invocation: edit shortcut: e external: "losslesscut {file}" leave_broot: false extensions: [ nut mp4 mov webm avi mpeg mkv ] } #{ # name: open-code # shortcut: e # execution: "$EDITOR +{line} {file}" # working_dir: "{root}" # leave_broot: false #}

By the way "details" is borken, all spaces are removed including with which sucks... and I can't put the summary in bold

Canop commented 2 years ago

It's hard for me to read your configuration but it's probable you can solve your problem by changing the order of the verb declarations: they're tried in order.

evanescente-ondine commented 2 years ago

Here: http://txt.do/t1p2z In that case, declarations are clearly not called in order, it starts with the generalist "$EDITOR +{line} {file}" declaration that does not contain declaration and is meant to replace the default "editor" verb and shortcut. when I comment out that verb, then it starts with the last "gimp {file}" declaration. Said otherwise they're tried in reverse order... And "extensions" are not taken into consideration.

Canop commented 2 years ago

I confirm there's a problem.

Canop commented 2 years ago

@evanescente-ondine can you confirm it's OK for you now ?

evanescente-ondine commented 2 years ago

It is not: when no extensions-less declarations exist, it does choose well. But a general declaration applies first and only if present, regardless of position or extensions.

Canop commented 2 years ago

I can't reproduce this :\

evanescente-ondine commented 2 years ago

Btw, setsid -f doesn't work with this commit, killing broot kills the program meant to be in the background. so I put back the older version.