Skip to content

fzf freezes the shell in version 0.68.1  #6534

Closed

Description

@amtoine

Describe the bug

i have some nushell functions, see the context down below, using fzf which are not working anymore...

  • ghq list | fzf shows me the list of my local repositories but freezes and does not let me choose a repo
  • cfg lf | fzf (cfg and lf are aliases for my git config. Here, cfg lf shows the lists of all my tracked config files) does not show anything and freezes before the fzf menu itself
  • same with cat ~/.bashrc | fzf, no output at all

when this occurs, i have to kill the terminal...

however, a standalone fzf, i.e. listing all the files in my HOME, works fine

all the commands above where working in 0.67.0 but stopped when i updated today to 0.68.1

cheers 😉 😋

How to reproduce

  1. install nushell, ghq and fzf
  2. run the commands
  • ghq list | fzf
  • cat .bashrc | fzf
  • fzf
  1. note that the first two do not work but the third does

Expected behavior

i would like ghq list | fzf to allow me to seach through the list of local repositories
i would like cat ~/.bashrc | fzf not to freeze and show something

Screenshots

No response

Configuration

Does not work in

key value
version 0.68.1
branch
commit_hash e76b3d6
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.63.0 (Arch Linux rust 1:1.63.0-1)
cargo_version cargo 1.63.0
pkg_version 0.68.1
build_time 2022-09-10 09:52:14 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Did work in

key value
version 0.67.0
branch
commit_hash 2ef9cc1
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.63.0 (Arch Linux rust 1:1.63.0-1)
cargo_version cargo 1.63.0
pkg_version 0.67.0
build_time 2022-09-04 11:30:04 +02:00
build_rust_channel debug
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

the context for the commands above can be found in my nushell scripts:

ghq list | fzf

the repo function

cfg lf | fzf

the vcfg function

NOTES

i've changed empty? to is-empty but that did not solve the issue

Activity

  1. fdncred commented on Sep 10, 2022

    @fdncred
    Contributor

    Most of this is too complicated to debug because I have no idea what ghq is nor what cfg is. However, I can get open some file | fzf to work. So, this may have something to do with how externals are handled.

  2. added
    A:external-commands
    on Sep 10, 2022
  3. amtoine commented on Sep 10, 2022

    @amtoine
    MemberAuthor

    Most of this is too complicated to debug because I have no idea what ghq is nor what cfg is.

    1. ghq is a git repositories manager -> ghq list gives a list of repository paths, one per line, e.g. i have two forks of some nushell repos, and thus
    > ghq list | grep nushell
    github.com/amtoine/nushell
    github.com/amtoine/nushell.github.io
    1. cfg is an alias for my dotfiles, namely alias cfg = ^git --git-dir ($env.HOME | path join ".dotfiles") --work-tree $env.HOME and git lf lists all the tracked files inside a repository
      in the end, cfg lf lists all my dotfiles!
      e.g. my nushell config
    cfg lf | grep nushell
    .config/nushell/config.nu
    .config/nushell/env.nu
    .config/nushell/login.nu
    .config/nushell/scripts/aliases.nu
    .config/nushell/scripts/colors.nu
    .config/nushell/scripts/completions.nu
    .config/nushell/scripts/final.nu
    .config/nushell/scripts/functions.nu
    .config/nushell/scripts/hooks.nu
    .config/nushell/scripts/keybindings.nu
    .config/nushell/scripts/menus.nu
    .config/nushell/scripts/themes.nu

    these are custom commands of course, hope my explainations make sense 😌
    in the end, ghq list and cfg lf only produce lines of raw texts with one path per line 👍

    However, I can get open some file | fzf to work. So, this may have something to do with how externals are handled.

    agree, ghq, cfg, a.k.a. git, and cat do not work, but open ~/.bashrc | fzf does 😮

  4. dandavison commented on Sep 10, 2022

    @dandavison
    Contributor

    Hi @amtoine, thanks for this, I suspect what you're encountering is this issue: #6496.

    What OS are you using?

  5. amtoine commented on Sep 10, 2022

    @amtoine
    MemberAuthor

    Hi @amtoine, thanks for this,

    hey 😋

    I suspect what you're encountering is this issue: #6496.

    that's quite similar indeed 😮

    What OS are you using?

    i'am on vanilla ArchLinux!

  6. fdncred commented on Sep 10, 2022

    @fdncred
    Contributor

    Good catch @dandavison. I reproduced the behavior on my Mac m1 too. I'd love to solve this issue once and for all. I've seen it creep up too many times recently.

  7. amtoine commented on Sep 10, 2022

    @amtoine
    MemberAuthor

    second time i have of an M1 chip / MacOs issue but on my asus / ArchLinux machine 😭
    i might be cursed 🤷 😋

  8. dandavison commented on Sep 10, 2022

    @dandavison
    Contributor

    Yes, I can also reproduce a hang with fzf on MacOS (also reported here: #6516).

    That is interesting that you're not on MacOS @amtoine!

    Looks like #6496 is the place to discuss further.

  9. amtoine commented on Sep 10, 2022

    @amtoine
    MemberAuthor

    @dandavison

    That is interesting that you're not on MacOS @amtoine!

    it is indeed 😮

    Looks like #6496 is the place to discuss further.

    mm the original issue from #6496 with yes | head -n 999 | with-env [LESS ""] { less } does not occur on my machine
    but still the same with ghq, cat and fzf 😕

  10. dandavison commented on Sep 10, 2022

    @dandavison
    Contributor

    I wonder if we can simplify the report here: I suspect that it doesn't matter what you are piping into fzf. Can you confirm that this shows the bug on your machine:

    ^yes | ^head -n 999 | fzf
    
  11. amtoine commented on Sep 10, 2022

    @amtoine
    MemberAuthor

    I wonder if we can simplify the report here: I suspect that it doesn't matter what you are piping into fzf. Can you confirm that this shows the bug on your machine:

    ^yes | ^head -n 999 | fzf
    

    it does work 🤔

    but cat README.md | less and do cat README.md | fzf not 😕
    this is the README.md from this very repo 👍

    and, still from this repo source
    yes | head -n 999 | git -c core.pager=less log works
    yes | head -n 999 | with-env [LESS ""] { less } works

  12. added this to the v0.69 milestone on Sep 11, 2022
  13. amtoine commented on Sep 12, 2022

    @amtoine
    MemberAuthor

    thanks a lot guys 🤩

    i built nushell with cargo build --workspace --features=extra; cargo run --features=extra on latest revision, i.e. 4490e97a1
    and all the issues above are gone 👍

    👇 below is the new working version of nushell 👇

    column0 column1
    version 0.68.2
    branch main
    commit_hash 4490e97
    build_os linux-x86_64
    build_target x86_64-unknown-linux-gnu
    rust_version rustc 1.63.0 (Arch Linux rust 1:1.63.0-1)
    cargo_version cargo 1.63.0
    pkg_version 0.68.2
    build_time 2022-09-12 08:22:14 +02:00
    build_rust_channel debug
    features database, dataframe, default, trash, which, zip
    installed_plugins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:external-commands

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions