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

Double-tab for completions breaks ctrl-c #9213

Open
mqudsi opened this issue Sep 16, 2022 · 2 comments
Open

Double-tab for completions breaks ctrl-c #9213

mqudsi opened this issue Sep 16, 2022 · 2 comments
Labels
bug Something that's not working as intended

Comments

@mqudsi
Copy link
Contributor

mqudsi commented Sep 16, 2022

Logging this to look into at a later date

I could swear I had written the apt completions to limit the number of matches but it seems not to be working causing sudo apt install a^I to hang/block due to the number of results (this isn't the issue). In this case:

  • If after pressing TAB once then, while it is blocked generating completions, ^C is pressed, the completion is aborted (the commandline flashes, the completion is aborted, and the contents of the commandline remain), but
  • If, after pressing TAB and once the completion generation has begun and the shell is blocked, TAB is pressed again, this seems to put the shell in an invalid state where the completion is aborted (and the commandline flashes but its contents are preserved) but subsequent ^C invocations do not trigger the ctrl-c binding to clear the prompt, though all other commandline manipulation (e.g. bkspc) work just fine. After manipulating the commandline (add a character, backspace out a character, etc) the ctrl-c binding works correctly and clears the prompt thereafter.
> bind \cc
bind --preset \cc cancel-commandline
bind \cc 'commandline -f cancel; commandline ""'

(This is all sounding very familiar to me; I think I need to search previous issues some more because I think this happened before and was patched/corrected subsequently.)

@krobelus krobelus added the bug Something that's not working as intended label Sep 17, 2022
@krobelus
Copy link
Member

Occasionally it happens that when I hit Control-C while completing a command, no completions are loaded.
If that happens, completions will also not be loaded later in the shell session, so I have to restart fish.
Not sure if it affects just the one original command or all commands.

@mqudsi
Copy link
Contributor Author

mqudsi commented Sep 17, 2022

Sorry, GitHub ate all my vim-denoted keystrokes (à la <ctrl-c>) in the original post (and I didn't notice) making it impossible to tell what keystrokes I was referring to -- I've update it. The problem is hitting tab/^I in the middle of a completion, not ^C - although I think I've run into the bug you describe before (which I also feel has been discussed at one point or the other).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants