Skip to content

Double-cell characters that get wrapped to the next line not removed from the screen when deleting #2984

Closed

Description

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

No exception.

Screenshot

Animation

Animation

Environment data

PS Version: 7.2.0-rc.1
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.1.0
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 91
BufferHeight: 25

Steps to reproduce

  1. Make sure the double-cell character wraps to the next line. It means that there is 1 cell buffer left on the current line for the double-cell character, so that character will be rendered to the next line.
  2. Start to delete characters, from the end, or from the middle of the line.
  3. You will see the double-cell character left behinds even though it's already removed from the buffer.

The GIF's in the screenshot section above are 2 examples.

Expected behavior

Deletion works as expected to remove the character from screen.

Actual behavior

The double-cell characters are left on screen, even though the characters were already removed from the text buffer.

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Nov 9, 2021
  2. added
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    and removed
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Nov 9, 2021
  3. daxian-dbw commented on Nov 9, 2021

    @daxian-dbw
    MemberAuthor

    The root cause of this issue is how we calculate the physical line count and the length of the last physical line for a logical line (see code here). The columns is the total buffer cells of the logical line (see code here), but it doesn't count into the possibility of the word warping for a double-cell character, which will make the logical line take up more cells than the calculated sum. This causes the line clearing to not work correctly in this case.

  4. changed the title [-]double-cell characters that get wrapped to the next line not removed from the screen when deleting[/-] [+]Double-cell characters that get wrapped to the next line not removed from the screen when deleting[/+] on Nov 9, 2021
  5. iSazonov commented on Nov 10, 2021

    @iSazonov

    Intersting, it seems pwsh has such wrapper too. Makes sense to have the code duplicate? I remember we fixed issues in pwsh wrapper code too. Maybe has one well-tested?

  6. daxian-dbw commented on Nov 10, 2021

    @daxian-dbw
    MemberAuthor

    I think the "wrapper" code you refer to is for word wrapping. It's different, here is the character wrapping that is done by the terminal/console, not the word wrapping.

  7. iSazonov commented on Nov 10, 2021

    @iSazonov

    Isn't this based on the "same" helper method to calculate cell width?

  8. daxian-dbw commented on Nov 10, 2021

    @daxian-dbw
    MemberAuthor

    I don't know, never really looked at the word wrapping code in PS :)

  9. iSazonov commented on Nov 10, 2021

    @iSazonov

    It doesn't cover all cases (use a workaround for simplicity). I think it could be good request for new API in .Net Runtime.

  10. ghost added
    In-PRA PR is opened targeting the issue
    on Nov 30, 2021
  11. ghost removed
    In-PRA PR is opened targeting the issue
    on Dec 14, 2021
  12. ghost added
    In-PRA PR is opened targeting the issue
    on Dec 14, 2021
  13. ghost removed
    In-PRA PR is opened targeting the issue
    on Jan 4, 2022
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

    Issue-BugIt either shouldn't be doing this or needs an investigation.Resolution-Fixed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions