linutil
linutil copied to clipboard
🦀 allow exiting out of search mode with `Ctrl-C`
Type of Change
- [x] UI/UX improvement
Description
Added an option to abort the search with Ctrl-C and fixed up the shortcut tooltip a bit.
Testing
Works perfectly.
Checklist
- [x] My code adheres to the coding and style guidelines of the project.
- [x] I have performed a self-review of my own code.
- [x] My changes generate no errors/warnings/merge conflicts.
Ctrl C must be used only for exiting the application. Ctrl C is generally used when the application is misbehaving. I am against this change
Ctrl C must be used only for exiting the application. Ctrl C is generally used when the application is misbehaving. I am against this change
why?
Ctrl C must be used only for exiting the application. Ctrl C is generally used when the application is misbehaving. I am against this change
vim, nano, helix, mysql, midnight commander, cmus, fzf
just off the top of my head. those tools utilize Ctrl C for their functionality. Ctrl C is not generally used when the application is misbehaving. That's Ctrl D. I'm sorry but you're wrong here.
Ctrl C is generally used when the application is misbehaving.
...
Ctrl C is generally used when the application is misbehaving.
...
its an exit command like the rest in linutil e.g. q esc, by your logic we should limit q & esc down to exiting linutil as well
No they are generally used for exiting for example closing other parts of an application also. But Ctrl c is more specific it is only used to close when the app is not responding, etc...
i got more:
more, less, man, tldr, gitui, bmon
Have you ever used an app that provides Ctrl c to close menus or exit search ?
No they are generally used for exiting for example closing other parts of an application also. But Ctrl c is more specific it is only used to close when the app is not responding, etc...
That's not true. Do you even use TUI tools? Just look at vim.
Have you ever used an app that provides Ctrl c to close menus or exit search ?
Yes. linutil (here), vi, vim, nvim, helix, nano, more, less, fzf, i don't even want to type anymore
htop, btop, top they use them to exit their application not exit the search. Vi, vim, nvim does the opposite they close with q instead and to force quit ctrl c is used ( if configured ). More, less also don't give the functionality to exit the search with ctrl c
htop, btop, top they use them to exit their application not exit the search
Oh yeah, sorry was wrong on this one.
Vi, vim, nvim does the opposite they close with q instead
No. Do you know how to use search in vi? I'll give you a tutorial:
- type
/while in normal mode - search for something
- change your mind and hit ctrl c
- see that it works
and to force quit ctrl c is used ( if configured ).
if configured...
More, less also don't give the functionality to exit the search with ctrl c
https://github.com/user-attachments/assets/202db4e9-4434-44ad-839c-23e271b1dc87
Yeah I mentioned if configured !! to map the CTRL C to exit the application. And still all the other applications you mentioned are wrong. This does not improve the UX. It makes it harder for the user to exit from the application
Yeah I mentioned if configured !!.
This is not configured !! ctrl c aborts search in vi by default
Yeah I mentioned if configured !!.
This is not configured !! ctrl c aborts search in vi by default
Am i not clear ?? If configured it can be used to exit the application with CTRL C
This does not improve the UX.
I find myself very frustrated having to use esc when I'm used to doing ctrl c. This definitely does improve UX.
It makes it harder for the user to exit from the application
Ctrl C does not exit linutil when in search mode. Test it.
This video proves bad UX. You can't argue with that.
https://github.com/user-attachments/assets/a3539ca2-3f1f-416b-9da2-24cb8447d88b
Ctrl C does not exit linutil when in search mode. Test it.
Users would want to use CTRL C to exit the application rather than aborting the search in case linutil needs to be force quit. Most of the applications except vi does that out of the box.
Users would want to use CTRL C to exit the application rather than aborting the search in case linutil needs to be force quit. Most of the applications except vi does that out of the box.
Do you need more examples?
- mc, ranger - copying files
- vi, vim etc - exiting modes, aborting commands
- irssi, weechat, a lot of IRC programs - copying, aborting, changing modes (depends)
- mutt - copying
- cmus - a lot of functions, depends
And, by the way, CTRL C does not forcequit linutil. It calls the exit function.
in case linutil needs to be force quit.
If an application "needs to be force quit", such as if it's hung or otherwise impossible to exit properly, you can send a SIGKILL with kill -9 $PID or killall -9 $EXECUTABLE_NAME. <C-c> has never served that purpose (SIGINT is voluntarily handled by the application), and a TUI with its own key handling will not receive any signal from that input.