broot icon indicating copy to clipboard operation
broot copied to clipboard

Run shell commands like tar and zip directly through broot terminal UI.

Open sohan-deshar opened this issue 1 year ago • 2 comments

Hi all. I couldn't find anything mentioned in the docs regarding the ability to run simple shell commands like tar and zip.

It would be nice to have such features (if there already isn't a way to do it), so that I won't have to leave broot.

sohan-deshar avatar Apr 25 '24 04:04 sohan-deshar

In my experience, there aren't so many cases when you run a command just taking the current file as path. You often need to pipe, or to specify another path.

For simple cases, a verb like this can be defined:

    {
        invocation: "exe {command}"
        external: ["bash" "-c" "{command} {file}"]
        leave_broot: false
    }

This allows typing eg :exe touch or :exe chmod +x and have the command applied to the selected file.

But in practice I'd just define the very few verbs for those actions.

(still interested with feedback on this)

Canop avatar Jul 21 '24 07:07 Canop

For simple cases, a verb like this can be defined:

    {
        invocation: "exe {command}"
        external: ["bash" "-c" "{command} {file}"]
        leave_broot: false
    }

This allows typing eg :exe touch or :exe chmod +x and have the command applied to the selected file.

But in practice I'd just define the very few verbs for those actions.

(still interested with feedback on this)

I would like to run add on from my functions sourced on .zshrc so when I do :exe add it fails since it doesn't exist in that context, however if I remove "bash" "-c" it does not work.

What options do I have besides sourcing inside sub-shell?

adriangalilea avatar Jul 30 '24 12:07 adriangalilea