Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fzf runs, even in transcript mode, on under-saturated commands #5190

Open
aryairani opened this issue Jul 6, 2024 · 0 comments
Open

fzf runs, even in transcript mode, on under-saturated commands #5190

aryairani opened this issue Jul 6, 2024 · 0 comments
Labels

Comments

@aryairani
Copy link
Contributor

Describe and demonstrate the bug
Please attach a ucm transcript if possible, calling out the unexpected behavior in the text. e.g.

Input:

```ucm:error
scratch/main> display
```

```unison
a = 1
```

```ucm
scratch/main> add
scratch/main> display
```

Output:

```ucm
scratch/main> display

⚠️

Sorry, I was expecting an argument for the definition to display, and I couldn't find any to suggest to you. 😅

```
```unison
a = 1
```

```ucm

  Loading changes detected in scratch.u.

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      a : ##Nat

```
```ucm
scratch/main> add

  ⍟ I've added these definitions:
  
    a : ##Nat

scratch/main> display

```

In the first ucm block, the display is about failing to launch fzf due to lack of suggestions, suppressing an error about not having provided any parameters. In the second ucm block, fzf launches and I hit Esc to exit, and it seems like the command is aborted with no output, instead of returning to the command's argument parser:

display :: InputPattern
display =
  InputPattern
    "display"
    []
    I.Visible
    [("definition to display", OnePlus, definitionQueryArg)]
    ( P.lines
        [ "`display foo` prints a rendered version of the term `foo`.",
          "`display` without arguments invokes a search to select a definition to display, which requires that `fzf` can be found within your PATH."
        ]
    )
    $ maybe
      (wrongArgsLength "at least one argument" [])
      (fmap (Input.DisplayI Input.ConsoleLocation) . traverse handleHashQualifiedNameArg)
      . NE.nonEmpty

Screenshots

image

Environment (please complete the following information):
ucm 0.5.23, macOS

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant