broot icon indicating copy to clipboard operation
broot copied to clipboard

verb with focus_staging_area_no_open remains active after invoking

Open AndydeCleyre opened this issue 8 months ago • 3 comments

Hello!

It looks like there's been a change between v1.45.0 and v1.45.1 affecting usage of the verb rm below.

Before: After using the verb with a staging area open and not focused, the filter/action line would be cleared.

After: After using the verb with a staging area open and not focused, the invocation command string remains on the filter/action line. At least the first time.

I discovered this when I intended to trash some files, then open one. Instead, I trashed the one I intended to open as well. It was recovered from the trash, nothing was really lost.

Verb definitions:

{
  invocation: trashcli {file}
  external: trash {file}
  leave_broot: false
}
{
  invocation: rm
  cmd: ":focus_staging_area_no_open;:trashcli {file}"
}

The external trash command is from andreafrancia/trash-cli.

It looks like the only commit between those versions was: https://github.com/Canop/broot/commit/0942e8fa48d730dde14d44884e4f3942680e69a4

AndydeCleyre avatar Apr 29 '25 15:04 AndydeCleyre

I'm sorry but I fail to reproduce. There's probably something I'm missing.

Canop avatar May 28 '25 09:05 Canop

Ok thanks I'll try to put together a better reproducer.

AndydeCleyre avatar May 28 '25 11:05 AndydeCleyre

$ podman run -it --rm alpine:edge

# apk upgrade
# apk add zsh broot trash-cli
# touch ~/.zshrc
# broot --install
# exec zsh

# <<EOF >~/.config/broot/verbs.hjson
verbs: [
  {
    invocation: trashcli {file}
    external: trash {file}
    leave_broot: false
  }
  {
    invocation: rm
    cmd: ":focus_staging_area_no_open;:trashcli {file}"
  }
]
EOF

# touch delme
# br  # select delme and hit ctrl+g, then invoke command: rm

rm will remain the command to be invoked if enter is hit a second time.

But do the above with alpine:latest instead (broot 1.44.2, down from 1.46.4), and this won't be the case.

AndydeCleyre avatar May 30 '25 06:05 AndydeCleyre