Bug report
Bug description:
The issue happens only when pulling a line from history.
Typing 4 spaces or a Tab and hitting Enter when at the PDB prompt is interpreted the same as hitting Enter without entering whitespace.
However, grabbing a whitespace-only line from history causes a prompt/line continuatin.
To reproduce:
- Type
if True: and hit Enter
- Type 4 spaces and hit Enter
- Type 4 spaces,
print("True") and hit Enter twice
- Hit the up arrow 2 times
- Hit Enter again
After those 5 steps you will see:

Repeatedly hitting Enter at that point shows the same continuation prompt:

The new REPL had a somewhat similar issue (#118911 was part of it).
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
The issue happens only when pulling a line from history.
Typing 4 spaces or a Tab and hitting Enter when at the PDB prompt is interpreted the same as hitting Enter without entering whitespace.
However, grabbing a whitespace-only line from history causes a prompt/line continuatin.
To reproduce:
if True:and hit Enterprint("True")and hit Enter twiceAfter those 5 steps you will see:
Repeatedly hitting Enter at that point shows the same continuation prompt:
The new REPL had a somewhat similar issue (#118911 was part of it).
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs