Skip to content

Conversation

@nindanaoto
Copy link
Contributor

Fixes connectbot/connectbot#1555

When copying text that spans multiple terminal lines, the selection logic would insert newlines at every visual line boundary, even for lines that wrapped due to terminal width (soft wraps). This caused long commands to break when pasted back. This PR also removes trailing whitespace from each line to ensure the copy matches the original.

Changes:

  • Add softWrapped field to TerminalLine to track soft vs hard line breaks
  • Expose libvterm's continuation flag via getLineContinuation() JNI method
  • Pass softWrapped status when pushing lines to scrollback
  • Update SelectionManager to only insert newlines for hard breaks
  • Trim trailing whitespace from each line when copying (terminal lines are padded with spaces to fill the terminal width)

🤖 Generated with Claude Code

When copying text that spans multiple terminal lines, the selection
logic would insert newlines at every visual line boundary, even for
lines that wrapped due to terminal width (soft wraps). This caused
long commands to break when pasted back.

Changes:
- Add softWrapped field to TerminalLine to track soft vs hard line breaks
- Expose libvterm's continuation flag via getLineContinuation() JNI method
- Pass softWrapped status when pushing lines to scrollback
- Update SelectionManager to only insert newlines for hard breaks
- Trim trailing whitespace from each line when copying (terminal lines
  are padded with spaces to fill the terminal width)

Fixes connectbot/connectbot#1555

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copy and paste annoying problem

1 participant