pycharm - 如何断开所有调试 session ?

标签 pycharm

在开发过程中,我经常会进行多次现场 session 。 PyCharm 为我提供了一个关闭所有调试器选项卡(或所有其他选项卡)的选项,但对于每个实时 session ,它都会弹出此对话框,我必须单击每个选项卡才能断开连接。有没有办法让PyCharm自动断开连接并终止所有进程?

enter image description here

最佳答案

也许这个问题的最佳答案是一开始就不要开始所有这些 session 。如果您真正想要做的是在启动调试器时终止现有 session ,请在“运行/调试配置”对话框中设置“仅单个实例”选项。

enter image description here

然后,每次单击调试图标(或 Shift+F9)时,它都会停止当前 session 并启动一个新 session 。在我弄清楚这是做什么之前,我最终会发现许多 session 仍在运行,尽管我对它们不再感兴趣。

PyCharm 帮助说明如下,但根据我的经验,选中此选项后,重新启动调试器只会杀死当前实例并启动一个新实例。当您不希望运行一堆旧实例时,这非常有用,但在构建 Django 应用程序并且您不希望多个实例尝试同时运行时,这一点至关重要。

If this check box is selected, this run/debug configuration cannot be launched more
than once.

Every time a new run/debug configuration is launched, PyCharm checks the presence of 
the other instances of the same run/debug configuration, and displays a confirmation
dialog box. If you click OK in the confirmation dialog box, the first instance of
the runner will be stopped, and the next one will take its place.

This make sense, when usage of certain resources can cause conflicts, or when
launching two run/debug configurations of the same type consumes too much of the CPU
and memory resources. If this check box is not selected, it is possible to launch as
many instances of the runner as required. So doing, each runner will start in its own
tab of the Run tool window.

关于pycharm - 如何断开所有调试 session ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21561673/

相关文章:

python - 如何让 venv 访问 PyCharm 中的 pygame 模块?

python - 如何在 for 循环中注释类型?

macos - 如何在pycharm中配置golang插件?

python - 谁能帮我解决这个 PyCharm 和 Import Modular 错误?

python - 在 PyCharm 中运行 Django 应用测试

phpstorm - 在 PyCharm 中,是否可以禁用隐藏样式标签?

python - 替换所有脚本 src 属性的正则表达式

python - 无法在 PyCharm 上安装 googleapiclient

opencv - 如何将自定义 Opencv 库添加到 pycharm

python - 如何在 PyCharm 中为所有项目安装包?