Open proItheus opened 6 months ago
What wrapping are you referring to ? Anything specific ? Can you please describe a complete failing case ?
Ah, sorry for being a bit ambiguous. By wrapping function I mean br
shell function. A failing case:
mkdir \'
br
in shell, and
:focus '
alt+enter
in broot.
What shell are you using ? bash ?
I've tested fish and bash.
Oh, sorry again, that's not the case, the failed case should be '
. Edited previous comment.
This problem can now (>1.33.1
) be avoided by using the following verb:
{
key: alt-enter
invocation: cd
cmd: ":write_output {directory};:quit"
}
with the following launcher function (Bash) (only slightly tested):
function br {
local path path_file code
path_file=$(mktemp)
if broot --verb-output "$path_file" "$@"; then
path=$(<"$path_file")
command rm -f "$path_file"
if [[ -d "$path" ]]; then
cd "$path"
fi
else
code=$?
command rm -f "$path_file"
return "$code"
fi
}
Broot's wrapping shell function does not escape file path, e.g.
test'"$(
, the shell will be crazy.In regard to how to escape, a stackoverflow post says:
That is,
test'"
as'test'\''" '