Jump to content


Photo

Kill Process Workflow


  • Please log in to reply
17 replies to this topic

#1 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 04:53 AM

I made a workflow to kill processes quickly.

 

You can grab it (and read more about it) on GitHub.

Direct download link.

 

Here are some highlights:

  • Autocompletes process names
  • Learns and prioritizes processes you kill frequently
  • Shows icons when possible
  • Shows CPU usage
  • Shows process paths
  • Ignores case

Screenshot:

screenshot.png

Enjoy, and feel free to share any feedback you have.


Edited by ngreenstein, 16 March 2013 - 05:30 AM.

  • nikipore, telonaes, Millan757 and 1 other like this

#2 samvlu

samvlu

    Member

  • Member
  • PipPip
  • 33 posts

Posted 16 March 2013 - 05:06 AM

Awesome! Just what I was looking for.

Works very well.


  • ngreenstein likes this

#3 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 08:29 AM

Very nice. I'd suggest though to pass the pid to args and kill using

kill -9 <pid>

This has less potential side effects.


Edited by nikipore, 16 March 2013 - 08:36 AM.


#4 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 03:35 PM

@samvlu Thanks, glad you like it!

@nikipore Hmm, source for that? I've never had issues with killall.

#5 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 03:46 PM

@ngreenstein: I mean that you might have several processes sharing a name; say you have three bash sessions, and only one of them hangs (CPU ~100%), would you want to kill'em all, or just the bad one?


  • ngreenstein likes this

#6 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 04:14 PM

Oh, great point. I didn't think of that at all. I'll update it today. Thanks for the feedback!

#7 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 05:20 PM

Ok, @nikipore, I updated it to use `kill -9` by default. Feel free to re-download.

 

You can still kill all processes with matching names by actioning with command-return.


  • nikipore likes this

#8 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 05:34 PM

Cool for the kill -9 part, much safer now. The command-return part is very nice (the best of both worlds), but is broken for me (it shows up, but no action results).


  • ngreenstein likes this

#9 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 05:38 PM

Oops, thanks for pointing that out. Forgot quotation marks, so processes with spaces in the name didn't work. Should be fixed now.


  • nikipore likes this

#10 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 05:54 PM

Nope. My test case: Open Terminal.app, press Command-N twice. Then you have two processes named "bash". Kill one of them just pressing Enter (works). Kill the other two pressing Command-Enter (doesn't work).



#11 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 06:00 PM

Try with anything other than bash and let me know if it works for you. I think the problem is that bash has a hyphen at the beginning of the process name and killall is trying to interpret that as a flag (even though it's in quotes). Any ideas?

 

Thanks for your help with testing this!


  • nikipore likes this

#12 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 06:08 PM

Now I started two Python interpreters. Their process name is something like this (these are MacPort Python 2.6 interpreteres, just in case you wonder):

 

 8980 ttys001    0:00.02 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python

 

And it doesn't work. I haven't looked into your code, but since youre identifying all processes correctly, why don't you pass all process IDs to the arg and put the row-specific pid in the first position? Then the scripts should pretty much look the same, except that one loops over all pids, and the other only picks the first one. No issues with weird names whatsoever.


Edited by nikipore, 16 March 2013 - 06:08 PM.


#13 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 06:15 PM

Ok, just pushed another update. Let me know if it changes anything.

 

It now works perfectly OMM for Python, bash, and every other process I've tried it with.

 

I don't have MacPorts to test with, but at this point I can't repro any issues.

 

Thanks for your help!


  • nikipore likes this

#14 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 06:30 PM

No, it doesn't. The two "-bash" test case still fails.



#15 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 06:31 PM

Can't repro at all. Works OMM. Sorry.



#16 nikipore

nikipore

    Member

  • Member
  • PipPip
  • 40 posts

Posted 16 March 2013 - 06:54 PM

Debugged it and found the reason: Due to a hotkey conflict, the action wasn't triggered at all. Everything works perfectly now. Thanks!



#17 ngreenstein

ngreenstein

    Newbie

  • Member
  • Pip
  • 9 posts
  • LocationSeattle

Posted 16 March 2013 - 06:55 PM

Great, glad it's sorted out.

 

Hope you find it useful :)



#18 altryne

altryne

    Member

  • Member
  • PipPip
  • 41 posts

Posted 16 March 2013 - 07:00 PM

awesome one! thanx

 

One thing, how about not requiring the query, and when there's no query, showing the top CPU consuming procceses, and then filtering by typed query?


Edited by altryne, 16 March 2013 - 07:02 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users