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

The "q" keyboard shortcut #243

Closed
szczja opened this issue Jun 12, 2021 · 6 comments
Closed

The "q" keyboard shortcut #243

szczja opened this issue Jun 12, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@szczja
Copy link

szczja commented Jun 12, 2021

Please consider changing, or adding additional dialog box for the "q" keyboard shortcut. For me is very common that during browsing, with many tabs open I accidentally press "q" and Amfora quits without any warning. I think that "q" is too simple for that command (just leave CTRL + q, like CTRL + w). Or Amfora should warns by "are you sure" dialog.

@yaxollum
Copy link

yaxollum commented Jun 14, 2021

Maybe there should be a configuration option like warn_before_quitting which people can set to false if they don't want a warning.

@makew0rld
Copy link
Owner

A configuration option would be best. I can add this eventually, or would accept a PR for it.

@makew0rld makew0rld added the enhancement New feature or request label Jun 24, 2021
@tteeoo
Copy link

tteeoo commented Sep 1, 2021

I've implemented this in a fork (https://github.com/tteeoo/amfora/tree/warn-before-quitting), and it works, but I came across some behavior that made me do it in a slightly odd way (perhaps I just don't know the codebase/libraries well enough). When you call the Stop() function inside of a goroutine (which it seems you need to do to create a cview modal), the interface clears but then hangs: the display.App.Run() call in amfora.go never returns. I have got it working by calling os.Exit(0) after Stop() (tteeoo@2097c35#diff-2a7077cf21b905f6c5f6c3cf5c971bb380a4e47b89a21701daeb45ce7a89a12bR215), although this seems clumsy to me. @makeworld-the-better-one do you have any suggestions as to how I can do this in a cleaner way? I can submit a PR if you think it's fine.

@makew0rld
Copy link
Owner

@tteeoo ideally you shouldn't need to that. I'm not sure what the solution is right now, but if I figure it out I'll let you know.

@okalm
Copy link

okalm commented Feb 4, 2022

Totally agree with the @szczja's remark, how many times I closed Amfora accidentally, I can't even count them it became a real problem.
The letter "q" is used for many things elsewhere that it's almost a habit to use it, sometimes I want to close a tab and hit q and then ... it's a total disaster I lose everything ^_^
May be just by switching it to "Q" (Shift+q) which imply the user to hit two key control could be a solution ?

@makew0rld
Copy link
Owner

Thanks for sharing your experience @okalm. I have changed the default so that the q key alone is no longer supported.

Note that you can already change what keys cause Amfora to quit by setting bind_quit in the [keybindings] section of your config. You could do something like this for example:

bind_quit = ["Q", "Ctrl-q"]

This would support shift-q and ctrl-q only.


Personally I will modify mine to keep the original behaviour:

bind_quit = ["Ctrl-C", "Ctrl-Q", "q"]

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

No branches or pull requests

5 participants