python / python/cpython

Save `pdb` Line History Between Runs

未关闭
#141,295 8 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

stdlib type-feature
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Feature or enhancement

Proposal:

When using pdb, it is possible to use the arrow keys (up/down) to navigate through previous commands. However, commands between runs are not preserved (unlike in the REPL).

I would like commands to be preserved between runs. For me, the most common use case for this is setting a breakpoint in the same place. Currently, I do this with python -m pdb -c "break file.py:line" ....

I am not familiar with how the pdb is implemented, but I have used bdb in depth in the past. I assume that it is possible to do this in a similar way to the REPL history. There is a workaround available here: https://stackoverflow.com/a/35390866/.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪 pdb 如何处理命令历史,并将其与 REPL 历史的行为进行比较;该 issue 指向 bdb 和入口点 python -m pdb -c。确认预期的持久化范围,然后验证在一次调试运行中输入的命令可在之后的运行中使用,同时不会破坏方向键导航或现有的 -c 命令。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
cli, devtools
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。