python / python/cpython

ctrl-w deletes words with punctuation instead of whitespace boundary

Open
#146,044 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib topic-repl triaged type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

I am used to ctrl-w deleting entire words, using whitespace as the boundary. Based on https://github.com/python/cpython/blob/3.14/Lib/_pyrepl/reader.py#L81, I think the Python REPL is supposed to do that?

However, ctrl-w currently deletes words using punctuation+whitespace as the boundary.

CPython versions tested on:

3.14

Operating systems tested on:

macOS

Linked PRs
  • gh-146174

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Lib/_pyrepl/reader.py around line 81, which the issue identifies as relevant to the REPL behavior. Reproduce ctrl-w in the Python 3.14 REPL on macOS and compare the current deletion boundary with the requested whitespace boundary. Done means punctuation remains part of the deleted word behavior as described, with the linked PR gh-146174 providing context.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.