Skip to content

Extra newline when copying line with wide glyph on the edge #11739

@Kagami

Description

@Kagami

Windows Terminal version (or Windows build number)

10.0.19043.1348, 1.12.2931.0

Other Software

Ubuntu 21.04 in WSL

Steps to reproduce

  1. Open tab with some WSL distro, shouldn't matter which.

  2. Create python3 file with the following content:

import os
import sys
cols = os.get_terminal_size().columns
sys.stdout.buffer.write(b'a'*(cols-1))
sys.stdout.buffer.write(b'\xea\xb0\x9c')
  1. Run it:
python3 1.py
  1. Copy output with the mouse and paste to some editor.

Expected Behavior

There should be only single line of text.

Actual Behavior

There're two lines of text, see screenshots.

1
2

The problem doesn't appear if that 3-byte symbol is not on the edge of the line. Also 2-byte symbols work fine too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-2A description (P2)Product-ConptyFor console issues specifically related to conpty

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions