python / python/cpython

The New REPL Command History Does Not Honor Partial Text

未關閉
#120,767 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

3.13 3.14 topic-repl type-bug
主要語言
Python
星號
77.2k
分支
35.9k
PR 合併指標
PR 指標待擷取

描述

Bug report

Bug description:

Let's say I fire up the REPL and start with the following:

>>> spam = 1
>>> ham = 2
>>> eggs = 3
>>> sp

At that point, I can up-arrow to scroll through my REPL command history. Normally with that partial sp on the line, hitting up-arrow once will immediately present spam = 1. Hitting it again will do nothing (since there are no more matching lines).

With the new REPL, it presents eggs = 3. Hitting it again will present ham = 2, and again it presents spam = 1. I'd rather it keep doing what it did before.

CC @ambv, @pablogsal

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-121859

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,在 Linux 上的 CPython main-branch REPL 中,使用報告中的 sp 範例重現部分輸入時的歷史記錄行為。將按向上箭頭得到的結果與預期的按前綴篩選歷史記錄的行為進行比較;當只顯示相符的歷史記錄項目並跳過不相關的項目時,問題即已解決。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。