Skip to content

Copying text includes trailing whitespace to edge of terminal #2778

@hathawad

Description

@hathawad

When selecting and copying text from the terminal, the copied content includes all trailing whitespace characters from the end of the text to the right edge of the terminal window.

Steps to reproduce

  1. Run any command that outputs text (e.g., echo "hello")
  2. Select the output text with mouse
  3. Paste into another application (like a text editor or browser)

Expected behavior

Only the visible text content is copied.

Actual behavior

Text includes trailing spaces padding out to the terminal width, requiring manual cleanup after pasting.

Environment

  • Wave version: 0.13.1
  • OS: macOS 14.2.1

Notes

This is a common issue in terminals. Many handle it with a "trim trailing whitespace on copy" setting or by using semantic (text-aware) selection rather than rectangular selection by default. iTerm2, for example, has a "Trim trailing whitespace" option under Preferences → General → Selection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions