FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pasting long line in new REPL causes text to appear after >>> · Issue #123177 · python/cpython · GitHub

Repository navigation

Pasting long line in new REPL causes text to appear after >>> #123177

Closed

Description

Bug report

Bug description:

When I paste code that is one line and my REPL window is small the text that would not be shown because it is offscreen is displayed after pressing enter.

For example I am pasting

thread = threading.Thread(target=lambda: threading.current_thread().name == 'MainThread')

After I paste and then press enter to create the object I see

>>> read')

I can't remove the text or use the arrow keys to navigate the letters since the >>> prompt is empty.

When the window is smaller more text is shown after >>>.

>>> thread = threading.Thread(target=lambda: threading.current_thread()\
                                                                                                                        >
>>> name == 'MainThread')

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Aug 20, 2024
  2. skirpichev commented on Aug 22, 2024

    Member

    Hmm, can someone reproduce this on recent main? Is this Mac-specific? I can't reproduce this on Linux.

  3. pablogsal commented on Aug 23, 2024

    Member

    I cannot reproduce exactly this, but there is something weird happening with macOS terminal application (I could not reproduce this with iTerm):

    Screen.Recording.2024-08-23.at.14.20.38.mov
  4. pablogsal commented on Aug 23, 2024

    Member

    This seems partially related to the cache but not fully. Removing the line cache shows the following problem:

    Screen.Recording.2024-08-23.at.14.34.00.mov
  5. pablogsal commented on Aug 23, 2024

    Member

    For some reason this only happens in the terminal app and not in iterm

  6. pablogsal commented on Aug 23, 2024

    Member

    Another problem: seems like the cache forces lines that warp around to also start with >>> (but they should not).

  7. pablogsal commented on Aug 23, 2024

    Member

    @godlygeek could you take a look at this if you have some free cycles?

  8. Siecje commented on Aug 23, 2024

    ContributorAuthor

    When I type random words like that as soon as I get to the end of the line I see strange behaviour including >>> moving.

    Screen.Recording.2024-08-23.at.9.39.44.AM.mov
  9. pablogsal commented on Aug 23, 2024

    Member

    What terminal are you using?

  10. pablogsal commented on Aug 23, 2024

    Member

    Can you try if #123267 fixes the other problem for you?

  11. Siecje commented on Aug 23, 2024

    ContributorAuthor

    What terminal are you using?

    The default "Terminal"

  12. pablogsal commented on Aug 23, 2024

    Member

    Can you run echo $TERM_PROGRAM?

  13. Siecje commented on Aug 23, 2024

    ContributorAuthor

    Apple_Terminal

  14. godlygeek commented on Aug 25, 2024

    Contributor

    Seems like there's two separate issues here, one with how Apple Terminal behaves when something is written to the last column of a line, and one with the cache. I understand what's causing the cache bug, but I'm still deciding how best to fix it.

  15. pablogsal commented on Aug 25, 2024

    Member

    Seems like there's two separate issues here, one with how Apple Terminal behaves when something is written to the last column of a line, and one with the cache. I understand what's causing the cache bug, but I'm still deciding how best to fix it.

    The apple terminal one it's being handled here: #123267

  16. added a commit that references this issue on Aug 25, 2024
  17. added a commit that references this issue on Aug 25, 2024
  18. added a commit that references this issue on Aug 25, 2024
  19. added a commit that references this issue on Aug 25, 2024
  20. godlygeek commented on Aug 25, 2024

    Contributor

    #123324 fixes the cache bug, and adds a test to exercise prompts with wrapping.

  21. added a commit that references this issue on Aug 25, 2024
  22. added a commit that references this issue on Aug 25, 2024
  23. added a commit that references this issue on Aug 26, 2024
  24. pablogsal commented on Aug 26, 2024

    Member

    Thanks for the report @Siecje and @godlygeek for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL