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

Fish widget disables certain ctrl-keys after completion #296

Closed
DenSA-Inc opened this issue Mar 20, 2020 · 3 comments
Closed

Fish widget disables certain ctrl-keys after completion #296

DenSA-Inc opened this issue Mar 20, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@DenSA-Inc
Copy link
Contributor

DenSA-Inc commented Mar 20, 2020

Describe the bug
After using the navi widget for the first time after pressing ctrl-g in the fish shell pressing ctrl-g again won't bring up the widget but print ^G in the shell. Other shortcuts such as ctrl-t and ctrl-u stop to work too. I didn't find any other way to resolve the issue than to restart the shell.

To Reproduce
Steps to reproduce the behavior:

  1. Open fish shell
  2. Run navi widget fish | source
  3. Press ctrl-g and select any entry or exit fzf with ctrl-g

Expected behavior
After running the widget I expect to bring it up again with ctrl-g or use other shortcuts just like before running the widget.

Screenshots

Versions:

  • OS: Ubuntu 18.04 and 19
  • Shell: Fish 2.7.1 & 3.1.0
  • navi: 2.2.0

Additional context
The problem lies in the call to stty sane, I'm no expert on that but I think it changes how the kernels terminal driver or fish handles input. This call changes a few terminal settings that aren't set to their previous values after navi completes. I added set ttysettings (stty -g) before and stty $ttysettings after the navi invocation in the code of navi-widget and that fixed it.

@DenSA-Inc DenSA-Inc added the bug Something isn't working label Mar 20, 2020
@welcome
Copy link

welcome bot commented Mar 20, 2020

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

@denisidoro
Copy link
Owner

Thank you for debugging it! Could you please open a PR with the fix? (otherwise I'll open the PR in the weekend)

@DenSA-Inc
Copy link
Contributor Author

You're welcome. I'll open a PR shortly.

DenSA-Inc added a commit to DenSA-Inc/navi that referenced this issue Mar 20, 2020
denisidoro added a commit that referenced this issue Mar 20, 2020
Fix fish widget changing tty settings (#296)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants