GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-139246: zero-width word paste can be wrong in default repl by yihong0618 · Pull Request #139254 · python/cpython

Conversation

@yihong0618

@yihong0618 yihong0618 commented Sep 23, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Pasting zero-width characters into PyREPL results in incorrect cursor position #139246

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yihong0618
fix: zero-width word paste can be wrong in default repl
30e130f
Signed-off-by: yihong0618 <[email protected]>
@yihong0618 yihong0618 changed the title fix: zero-width word paste can be wrong in default repl gh-139246: zero-width word paste can be wrong in default repl Sep 23, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Sep 23, 2025
Pasting zero-width characters into PyREPL results in incorrect cursor position #139246
Open
grayjk
grayjk suggested changes Sep 23, 2025
View reviewed changes
Comment thread Lib/_pyrepl/utils.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_pyrepl/utils.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting core review label Sep 23, 2025
@yihong0618
fix: address comments
07aa4bc
Signed-off-by: yihong0618 <[email protected]>
@yihong0618
yihong0618 requested a review from grayjk September 24, 2025 00:14
@yihong0618
yihong0618 marked this pull request as ready for review September 24, 2025 00:14
@yihong0618
yihong0618 requested review from ambv, lysnikolaou and pablogsal as code owners September 24, 2025 00:14
@bedevere-app bedevere-app Bot added awaiting review and removed awaiting core review labels Sep 24, 2025
grayjk
grayjk reviewed Sep 24, 2025
View reviewed changes
Comment thread Lib/_pyrepl/utils.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@yihong0618 @grayjk
apply suggestion Lib/_pyrepl/utils.py
41d2865
Co-authored-by: grayjk <[email protected]>
grayjk
grayjk reviewed Sep 24, 2025
View reviewed changes
Comment thread Lib/_pyrepl/utils.py
@@ -63,6 +63,14 @@ class ColorSpan(NamedTuple):
def str_width(c: str) -> int:
if ord(c) < 128:

@grayjk grayjk Sep 24, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this issue but quite a few of the characters with ord < 128, do not have a display width of 1

for example, in my terminal, tab (ord 9) is 8 charaters wide

something to consider for a future PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yihong0618 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@yihong0618 yihong0618 mentioned this pull request Oct 23, 2025
Python3.15.0a1 REPL : issue with pasting of Tab indented multiline code #140502
Open
encukou
encukou reviewed Oct 30, 2025
View reviewed changes
Comment thread Lib/_pyrepl/utils.py Outdated
category = unicodedata.category(c)
if category == "Cf" and c != "\u00ad":
return 0
if "\u2028" <= c <= "\u2029":

@encukou encukou Oct 30, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, what terminal are you using? Here (on VTE) these take up one cell.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yihong0618 yihong0618 Oct 30, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mac with kitty

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@grayjk grayjk Oct 30, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if \u2028 and \u2029 aren't consistent across terminals, could remove this condition since it is unrelated to the original issue

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yihong0618 yihong0618 Oct 30, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course will do it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yihong0618 yihong0618 Oct 30, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yihong0618
fix: apply suggestion
8bde6aa
Signed-off-by: yihong0618 <[email protected]>
encukou
encukou approved these changes Oct 30, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Oct 30, 2025
@encukou
encukou merged commit 4e6dba0 into python:main Oct 30, 2025
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 30, 2025
@encukou encukou added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Oct 30, 2025
@miss-islington-app

miss-islington-app Bot commented Oct 30, 2025

Copy link
Copy Markdown

Thanks @yihong0618 for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Oct 30, 2025

Copy link
Copy Markdown

Thanks @yihong0618 for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Oct 30, 2025

Copy link
Copy Markdown

Sorry, @yihong0618 and @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4e6dba0ef74523a52f66547c16b9972664b18fd4 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned encukou Oct 30, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 30, 2025
@yihong0618 @grayjk @miss-islington
pythongh-139246: zero-width word paste can be wrong in default repl (p…
1d1a971
…ythonGH-139254)

(cherry picked from commit 4e6dba0)

Co-authored-by: yihong <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Co-authored-by: grayjk <[email protected]>
@bedevere-app

bedevere-app Bot commented Oct 30, 2025

Copy link
Copy Markdown

GH-140796 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 30, 2025
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Nov 6, 2025
@yihong0618 @grayjk @StanFromIreland
[3.13] pythongh-139246: zero-width word paste can be wrong in default…
1a8b6b5
… repl (pythonGH-139254)

(cherry picked from commit 4e6dba0)

Co-authored-by: yihong <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Co-authored-by: grayjk <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 6, 2025

Copy link
Copy Markdown

GH-141166 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Nov 6, 2025
encukou pushed a commit that referenced this pull request Nov 7, 2025
@miss-islington @yihong0618 @grayjk
[3.14] gh-139246: zero-width word paste can be wrong in default repl (G…
d729087
…H-139254) (GH-140796)

gh-139246: zero-width word paste can be wrong in default repl (GH-139254)

(cherry picked from commit 4e6dba0)

Signed-off-by: yihong0618 <[email protected]>
Co-authored-by: yihong <[email protected]>
Co-authored-by: grayjk <[email protected]>
encukou pushed a commit that referenced this pull request Nov 7, 2025
@StanFromIreland @yihong0618 @grayjk
[3.13] gh-139246: zero-width word paste can be wrong in default repl (G…
0923704
…H-139254) (GH-141166)

(cherry picked from commit 4e6dba0)

Signed-off-by: yihong0618 <[email protected]>
Co-authored-by: yihong <[email protected]>
Co-authored-by: grayjk <[email protected]>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
@yihong0618 @grayjk @StanFromIreland
pythongh-139246: zero-width word paste can be wrong in default repl (p…
7281913
…ythonGH-139254)

Signed-off-by: yihong0618 <[email protected]>
Co-authored-by: grayjk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou approved these changes
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
@ambv ambv Awaiting requested review from ambv ambv is a code owner
+1 more reviewer
@grayjk grayjk grayjk requested changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@encukou encukou

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@yihong0618 @encukou @grayjk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.