fzf icon indicating copy to clipboard operation
fzf copied to clipboard

how to show the spinner when enabled the `--inline-info --info=inline`

Open marslo opened this issue 9 months ago • 4 comments

Checklist

  • [x] I have read through the manual page (man fzf)
  • [x] I have searched through the existing issues
  • [x] For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

HEAD-93cb375 (brew)

OS

  • [ ] Linux
  • [x] macOS
  • [ ] Windows
  • [ ] Etc.

Shell

  • [x] bash
  • [ ] zsh
  • [ ] fish

Problem / Steps to reproduce

the FZF_DEFAULT_OPTS set as below:

FZF_DEFAULT_OPTS="--inline-info --info=inline "
FZF_DEFAULT_OPTS+="--info-command='echo \"\x1b[33;1m\$FZF_POS\x1b[m/\$FZF_INFO\"' "

export FZF_DEFAULT_OPTS

result

$ echo $FZF_DEFAULT_OPTS 
--inline-info --info=inline --info-command='echo "\x1b[33;1m$FZF_POS\x1b[m/$FZF_INFO"'

$ ... | fzf

spinner will not show when --info=inline been set.


screencast as below:

  • has spinner :

    $ unset FZF_DEFAULT_OPTS; \
      export FZF_DEFAULT_OPTS='--height 35% --min-height 8+'; \
      echo $FZF_DEFAULT_OPTS 
    --height 35% --min-height 8+
    

    https://github.com/user-attachments/assets/a10cfbdc-8658-48e7-88ce-7f9ec6619d4c

  • no spinner :

    $ unset FZF_DEFAULT_OPTS; \
      export FZF_DEFAULT_OPTS="--height 35% --min-height 8+ --inline-info --info=inline --info-command='echo \"\x1b[33;1m\$FZF_POS\x1b[m/\$FZF_INFO\"' "; \
      echo $FZF_DEFAULT_OPTS 
    --height 35% --min-height 8+ --inline-info --info=inline --info-command='echo "\x1b[33;1m$FZF_POS\x1b[m/$FZF_INFO"'
    

    https://github.com/user-attachments/assets/4d20df7f-da8a-4b29-a255-b1fb25747bf3

marslo avatar Apr 11 '25 08:04 marslo

Inline info doesn't show the spinner, unfortunately. But if you look closely, the color of < changes when the loading is complete, from the color of spinner to the color of prompt.

fzf --color spinner:red,prompt:yellow --info 'inline: look-at-me ' < <(sleep 3)

junegunn avatar Apr 11 '25 09:04 junegunn

thanks @junegunn, yes I do see the color changes ( as below ). By the way, will you integrate the spinner feature into inline mode in the future ?

Image

marslo avatar Apr 11 '25 09:04 marslo

I don't know where to put it, and that's why I introduced the color change in the first place when I added the inline option as an alternative way to show the loading status.

junegunn avatar Apr 13 '25 11:04 junegunn

maybe somewhere we can define it in the info line, something like:

#                  something like this
#                         v
--info-command='echo "$SPINNER \x1b[33;1m$FZF_POS\x1b[m/$FZF_INFO"' 

marslo avatar Apr 15 '25 04:04 marslo