无法在 sublime text 2 中杀死 python 进程 [英] Can't kill a python process in sublime text 2

查看:35
本文介绍了无法在 sublime text 2 中杀死 python 进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了很多地方,但似乎无法找到正确的关键字.我在 Sublime 中的 Python 中有一个拖延过程,导致 Mac 上的死亡沙滩球.我无法访问工具">取消构建"按钮,并且 Control + C 不起作用.如何终止此进程?

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 can't access the Tools > Cancel Build button and Control + C doesn't work. How do I kill this process?

推荐答案

我还没有找到在不杀死所有 Sublime 的情况下杀死 Sublime 中的进程的方法.但我确实找到了一种方法,可以让杀死和重新打开 Sublime 的痛苦少得多.这是我的方式.

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:这会打开强制退出窗口.
  2. 强制退出窗口会询问您是否真的要退出 Sublime 两次.只需按两次输入即可.
  3. 崩溃报告器窗口将打开.我讨厌这个窗口,因为它漂浮在所有东西的顶部,所以你不能忽略它,关闭它会让我做额外的按键,所以我 禁用它.
  4. 重新打开崇高.当 Sublime 重新打开时,它会打开您在崩溃前打开的所有文件,将您带回到原来的位置.

许多人认为重新打开 Sublime 很麻烦,因为他们必须用鼠标导航到应用程序目录,这个过程大约需要 10 到 30 秒.我曾经觉得这很烦人,所以我设置了它,以便我可以通过五次击键重新打开 sublime,大约需要三秒钟.

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.

首先,我安装了 Alfred.在这种情况下,您只需要免费版的 Alfred.

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

安装 Alfred 后,执行以下操作:

With Alfred installed, do the following:

  1. option-spacebar 调出 Alfred 搜索栏.Alfred 很像您计算机上的 Google 搜索.
  2. 输入字母su".在 Alfred 搜索栏下方,会出现一堆选项,第一个选项是 Sublime Text 2.Alfred 会自动突出显示其搜索结果列表中的第一项,因此当您按 Enter 键时,它会启动突出显示的应用程序.
  3. 按回车键.阿尔弗雷德打开 Sublime.瞧:Sublime 又回到了你运行脚本之前的样子.

所以,总的来说,一旦我开始一个冻结 Sublime 的进程,我会执行以下 10 次按键操作:

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

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

此过程确实使强制退出应用程序窗口悬而未决,因为我还没有找到一种快速的方法来摆脱它而不向我的系统添加十次额外的击键.如果它真的让我感到困扰,我会单击窗口并执行 cmd-w,这会关闭窗口.

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.

另一个烦人的事情是 Sublime 重新启动需要几秒钟,所以通常我不会费心在 Sublime 中运行东西.相反,我转到终端并在那里运行一些东西,这样我就可以 Ctrl-C 我正在测试的脚本而不会影响 Sublime.

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.

此外,Tools > Cancel Build 选项还有一个键盘快捷键.我从未使用过它,但是在 此论坛帖子.

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.

这篇关于无法在 sublime text 2 中杀死 python 进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆