-
-
Notifications
You must be signed in to change notification settings - Fork 266
Open
Labels
enhancementNew feature or requestNew feature or request
Description
$ broot --send asdlfkasdjfaskldf -c ':focus /home'
error on the socket: No such file or directory (os error 2)
Currently this yields an exit code 0
. I request that this be changed to any non-zero exit code, to better reflect a failure condition, when used in a scripting context.
Currently:
$ broot --send asdlfkasdjfaskldf -c ':focus /home' && echo "great success"
error on the socket: No such file or directory (os error 2)
great success
I think this is reasonable on general principle, but my very specific use case is a Zsh function which opens a broot view in an unfocused tmux "side pane." A hook is added to the shell environment so that the broot instance changes directory to match the main pane. If I later close that broot instance, I want to remove the hook.
I thought the simplest method to do so might be to have the hook function remove itself if the broot --send
command ever fails:
# -- Pinned view in another tmux pane --
broot-pin () {
emulate -L zsh
local name=$RANDOM
eval '
update_pinned_broot_$name () {
if ! { broot --send '$name' -c ":focus $PWD" 2>/dev/null } {
add-zsh-hook -d precmd $0
unfunction gob
}
}
gob () {
emulate -L zsh
cd "$(broot --send '$name' --get-root)"
}
'
add-zsh-hook precmd update_pinned_broot_$name
tmux splitw -d -h -l 70 broot --listen $name
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request