如何与所有调试会话断开连接? [英] How to disconnect from all debug sessions?

查看:54
本文介绍了如何与所有调试会话断开连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发过程中,我经常以多个实时会话结束.PyCharm 为我提供了关闭所有调试器选项卡(或所有其他选项卡)的选项,但对于每个实时会话,它都会显示此对话框,我必须单击每个选项卡才能断开连接.有没有办法让 PyC​​harm 自动断开并终止所有进程?

During development I often end up with multiple live sessions. PyCharm gives me an option to close all debugger tabs (or all other tabs), but for each live session it brings up this dialog and I have to click on each one to disconnect. Is there a way to make PyCharm automatically disconnect and terminate all processes?

推荐答案

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

Maybe the best answer to the question is to not start all these sessions in the first place. If what you really want to do is kill the existing session when you start the debugger, set the "Single instance only" option in the Run/Debug Configurations dialog.

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

Then each time you click the debug icon (or Shift+F9) it will stop the current session and start a new one. Before I figured out what this did, I would end up with a number of sessions still running even though I was no longer interested in them.

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

The PyCharm help says the following, but in my experience, with this checked, restarting the debugger just kills off the current instance and starts a new one. This is useful when you don't want a bunch of old instances running, but it is critical when building a Django app and you don't want multiple instances trying to run at the same time.

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.

这篇关于如何与所有调试会话断开连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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