pando85 / timer

Simple countdown terminal alarm. Useful for pomodoros too.
GNU General Public License v3.0
28 stars 0 forks source link

[NEW] Support exit with Q #44

Closed Mrfiregem closed 1 year ago

Mrfiregem commented 2 years ago

Is your feature request related to a problem? Please describe. Right now, it looks like you can only stop the timer early with the usual ctrl-c.

Describe the solution you'd like It would be nice if you followed termdown and supported closing with the q key.

pando85 commented 2 years ago

Hello @Mrfiregem ,

To explain a little bit about the context. Right know, timer handles interruption signals and it is not programmed to be interactive.

I don't know if this is a functionality that I want to add because this opens the to a new interactive commands that I'm not sure if they could be useful. Could you explain a little bit about how do you use it or what do you expect from this program? It will be useful to understand it better.

Also, as workaround you can change SIGINT mapping to q key:

stty intr q
Mrfiregem commented 2 years ago

For my use case, it's just a force of habit to press q to quit out of terminal applications, and requires less effort to hit one key instead of two.

I suppose an actual reason to implement this, however, would be if someone is using this command in a pipeline then a way to stop the timer early while returning a successful exit code would be helpful. I'm not sure whether that is all too realistic, though as one would must likely just use sleep 😅.

pando85 commented 2 years ago

It could be an idea. Also, if we do it interactive it could support a pause command.

lyz-code commented 2 years ago

I also tried to quit it with q :P

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.