tj / pomo

Ruby Pomodoro app for the command-line (time / task management)
MIT License
525 stars 53 forks source link

Add `pomo stop` #28

Open stephenmckinney opened 11 years ago

stephenmckinney commented 11 years ago

Stopping a task should include:

Possible option for maintaining processes: https://github.com/rjackson/singleton_process

ghost commented 11 years ago

Yeah, we need 'pomo stop'. Now I use this script to kill the running pomo.

kill -9 $(ps aux | awk '/bin\/pomo/ {print $2}') 2> /dev/null
sed 's/running: true/running: false/g' ~/.pomo > ~/.pomo_temp
mv ~/.pomo_temp ~/.pomo
echo '#[default]#[fg=green]00:00#[default]' > ~/.pomo_stat
stephenmckinney commented 11 years ago

Good point on reseting ~/.pomo_stat. I updated the ticket.

I'd like to write a pid file on fork and use that to kill the process, I just haven't had time to code it up. A pomo pause would be great too.

jhwist commented 11 years ago

With pomo pause it would then be also possible to count the interruptions for a particular pomo.

cbfrance commented 11 years ago

+1 for stop or pause functionality

stephenmckinney commented 11 years ago

Unless there are any objections, I am going to make pomo run exclusively as a background process and eliminate pomo start --progress. This will make this feature much easier to implement and it seems no one is using it as a foreground process anyway.

jhwist commented 11 years ago

Well, yes I am using it ... on Windows, gasp, as Ruby lacks native fork support there and running in foreground is a nice workaround. Having said that, go ahead and kill --progress as I'd rather see tomato support first. I can come up with a hack for Windows later.