Can't kill a python process in sublime text 2

后端 未结 9 1020
难免孤独
难免孤独 2021-02-04 14:06

I\'ve searched in a lot of places but I can\'t seem to get the keywords correct. I have a stalling process in Python in Sublime that causes the beachball of death on a Mac. I ca

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 14:17

    I have not found a way to kill a process in Sublime without killing all of Sublime. But I did find a way to make killing and reopening Sublime much less painful. Here is my way.

    1. Command-option-escape: This brings up the force-quit window.
    2. The force-quit window will ask you if you really want to quit Sublime twice. Just hit enter twice.
    3. A crash reporter window will open. I hated this window, because it floats on top of everything so you can't ignore it, and closing it made me do extra keystrokes, so I disabled it.
    4. Reopen sublime. When Sublime re-opens, it opens all of the files you had open before it crashed, taking you back to where you were.

    Many people think reopening Sublime is pain in the butt because they have to navigate to the Applications Directory with their mouse, a process which takes about 10 - 30 seconds. I used to find this annoying, so I set it up so that I could reopen sublime with five keystrokes, and it takes me about three seconds.

    First, I installed Alfred. In this case, you only need the free version of Alfred.

    With Alfred installed, do the following:

    1. option-spacebar brings up the Alfred search bar. Alfred is a lot like Google Search for your computer.
    2. Type the letters "su." Below the Alfred search bar, a bunch of options appear, and the first option is Sublime Text 2. Alfred automatically highlights the first thing on it's list of search results, so that when you hit enter, it will launch the highlighted application.
    3. Hit enter. Alfred opens Sublime. Voila: Sublime is back to how it was before you ran the script.

    So, in total, once I start a process that freezes Sublime, I do the following 10 keystrokes:

    Cmd-option-escape enter enter option-spacebar s u enter

    This procedure does leave the Force Quit Applications window hanging around, because I have not found a quick way to get rid of it without adding ten extra keystrokes to my system. If it really bugs me, I click on the window and do cmd-w, which closes the window.

    The other annoying thing is that it takes a couple of seconds for Sublime to relaunch, so usually I don't bother to run things from within Sublime. Instead, I go over to the terminal and run things there, so that I can Ctrl-C the script I'm testing without affecting Sublime.

    Additionally, there is a keyboard shortcut for the Tools > Cancel Build option. I have never used it, but using it and fixing problems with it is discussed in this forum post.

提交回复
热议问题