invalid command or invalid broot behavior ?
the function { invocation: names key: ctrl-n external: "wl-copy (basename -a {file})" leave_broot: false apply_to: any }
results in :
wl-copy: invalid option -- 'a' Usage: wl-copy [options] text to copy wl-copy [options] < file-to-copy Copy content to the Wayland clipboard.
Even though the same command in the terminal works fine... What did I do wrong ?
I don't know what's wl-copy but you should probably use the array form. See https://dystroy.org/broot/conf_verbs/
wl-copy is part of wl-clipboard, to copy/paste stuff in wayland using commands. external: ["wl-copy" "(basename -a {file})"] substitutes {file} but wl-copy only copies the resultant string starting with "(basename" ending with ')' I use fish shell, which processes things in parentheses as commands whose results must be inserted in there. Some incompatibility perhaps ? Also, eventhough the "-a" parameters of basename allows for several files to be processed (I tried), here, even within the stagging area, only the first name is substituted
wl-copy (basename -a {file}) must be a fish shell feature the command is not interpreted by the shell in broot (I guess ?)
basename is part of coreutils, wl-copy is a normal program. Only () is FISH-specific and replaces $( ) in BASH. Considering the author was kind enough to provide the FISH function for "br", I doubt this is the issue... Could someone try and do execute this { invocation: names key: ctrl-n external: "wl-copy (basename -a {file})" [with perhaps: external: ["wl-copy" "(basename -a {file})"] instead ? ] leave_broot: false apply_to: any }
Any wayland desktop would do. Just to be sure it's not only on my side.
@Stargateur might be right, here, it that this command probably needs to be executed in a shell, either by calling something like external ["sh" "-s" "wl-copy (basename -a {file})"] or by adding a specific mode for that in broot command executions.
Any variant of
external: "fish -c wl-copy (basename -a {file})"
with array form or -C instead of both, with or without & and ";exit" or both, results in a black screen with a blinking prompt, but no shell.
external: "bash -r -c wl-copy $(basename -a {file})" does the same.
OK, I'll have to have a look when I find the time.