Skip to content

Copying soft-wrapped output still drops space at wrap boundary on v1.0.65 (incomplete fix of #3666) #3964

Description

@coseguera

Describe the bug

Copying soft-wrapped output from the Copilot CLI's terminal still drops the
space at a wrap boundary, gluing two words together. This appears to be an
incomplete fix of #3666 (closed as fixed in v1.0.49): that issue's last
commenter reported it persisting on v1.0.59 at the second wrap boundary, and
I can still reproduce it on v1.0.65.

When a word is the last token on one visual (soft-wrapped) row and the next word
is the first token on the following row, the copied text rejoins the rows
without reinserting the space the wrap represented.

Concrete example

A line of assistant output that rendered (soft-wrapped) as:

... so it
faithfully copies borders and wrap-newlines. ...

was copied to the clipboard as:

... so it faithfully copiesborders and wrap-newlines. ...

copies borders collapsed into copiesborders. The space at the wrap seam
between copies (end of one visual row) and borders (start of the next) was
lost. The rest of the spacing was preserved.

Expected behavior

Copied text should preserve all spaces, reinserting the inter-word space at
every soft-wrap boundary (not just the first).

Actual behavior

The space is dropped at a wrap boundary, changing the text. For code this is
significant (e.g. var c -> varc, as noted in #3666).

Reproduction steps

  1. Start the Copilot CLI in a terminal narrow enough to force soft-wrapping of a
    long line of prose or code.
  2. Ensure a space between two words falls exactly at a soft-wrap boundary.
  3. Copy that output (Ctrl+C).
  4. Paste elsewhere: the two words across the wrap seam are joined with no space.

Notes

  • File output is unaffected (asking the CLI to write the same text to a file
    preserves spaces); only the terminal copy path is affected. This matches the
    observation in Copying wrapped GitHub Copilot CLI output can turn var c into varc #3666.
  • Reproduced on a headless Linux host accessed over SSH, with the CLI running in
    a tmux window (not nested in an editor terminal).

Version

GitHub Copilot CLI 1.0.65

Related

Likely an incomplete fix of #3666.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions