Adjust selection when resizing window #1815

Closed
opened 2026-01-30 22:37:15 +00:00 by claunia · 3 comments
Owner

Originally created by @mcpiroman on GitHub (Jun 21, 2019).

Originally assigned to: @carlos-zamora on GitHub.

Environment

commit 0846464

Steps to reproduce

  1. Start new terminal session
  2. Have some long line that fits viewport, e.g. write a 40 times
  3. Select text in that line
  4. Gradually shrink window horizontally (reduce width)

Expected behavior

When selected text gets wrapped or moves downward (due to previous lines being wrapped), selection should follow.

Actual behavior

Selection stays at one line and doesn't move.

Originally created by @mcpiroman on GitHub (Jun 21, 2019). Originally assigned to: @carlos-zamora on GitHub. # Environment commit 0846464 # Steps to reproduce 1. Start new terminal session 2. Have some long line that fits viewport, e.g. write `a` 40 times 3. Select text in that line 4. Gradually shrink window horizontally (reduce width) # Expected behavior When selected text gets wrapped or moves downward (due to previous lines being wrapped), selection should follow. # Actual behavior Selection stays at one line and doesn't move.
Author
Owner

@carlos-zamora commented on GitHub (May 13, 2020):

At some point, I changed the behavior to be that selection clears on resize.

I'm treating this issue now as a feature request for adjusting the selection when resizing.

@carlos-zamora commented on GitHub (May 13, 2020): At some point, I changed the behavior to be that selection clears on resize. I'm treating this issue now as a feature request for adjusting the selection when resizing.
Author
Owner

@DHowett-MSFT commented on GitHub (May 13, 2020):

I'm not sure the value in keeping the selection during resize. Why should we do it?

@DHowett-MSFT commented on GitHub (May 13, 2020): I'm not sure the value in keeping the selection during resize. Why should we do it?
Author
Owner

@carlos-zamora commented on GitHub (May 13, 2020):

Actually, yeah. I just realized this issue was submitted almost a year ago haha. The issues with maintaining the selection on a resize is that (as noted by this issue) the selection anchors can't be guaranteed to point to the same text once text wraps in the buffer. It's a lot of extra work and not really worth it, considering that the user can easily just do another selection.

I'll close this out, for now, until proven otherwise that there's value in keeping a selection after a resize.

@carlos-zamora commented on GitHub (May 13, 2020): Actually, yeah. I just realized this issue was submitted almost a year ago haha. The issues with maintaining the selection on a resize is that (as noted by this issue) the selection anchors can't be guaranteed to point to the same text once text wraps in the buffer. It's a lot of extra work and not really worth it, considering that the user can easily just do another selection. I'll close this out, for now, until proven otherwise that there's value in keeping a selection after a resize.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1815