Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy on Select ignore trailing whitespaces #6869

Open
david50407 opened this issue Jul 11, 2020 · 4 comments
Open

Copy on Select ignore trailing whitespaces #6869

david50407 opened this issue Jul 11, 2020 · 4 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@david50407
Copy link

Description of the new feature/enhancement

While copying on select, auto ignore trailing whitespaces on each line.

Why?

In my .vimrc, I draw 80 column and 120 column line via background color like this:

image

function! SetColumnWarnOnResized()
  highlight Normal ctermbg=NONE
  if &columns > 120
    let &colorcolumn="81,".join(range(120, &columns), ",") " Set the column warns on 80 and 120+
  else
    let &colorcolumn="81" " Set the column warns on 80
  endif
endfunction
au VimResized * call SetColumnWarnOnResized()
call SetColumnWarnOnResized()     

When I select and copy these words in the screenshot above, Windows Terminal will fill my clipboard with many whitespaces like this (notice that wired whitespaces):

Some texts here...
And here...                                                                                                                                                         Notice the 80 col line in my vim --------------------------------------------->
And the 120 col line ================================================================================================>       

And this only happend sometimes (not always), I don't know if this is a bug?

Related issues

This issues may relatives to these issues:

@david50407 david50407 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 11, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 11, 2020
@zadjii-msft
Copy link
Member

Huh. The nearly-exact wrapping there is really curious.

@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jul 16, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 16, 2020
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Jul 16, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 16, 2020
@DHowett
Copy link
Member

DHowett commented Jul 16, 2020

This could be related to vim printing the entire row of text when it wants to apply a style to the 81st+ columns. We can't meaningfully know the difference between it wanting text over there and it wanting spaces over there. Hmm.

@david50407
Copy link
Author

Hummm... So the workaround is not to print background on the last column.

But other terminals like gnome terminal (on Linux) and PuTTY (on Windows) can handle this well without trailing whitespaces, is there any technological issue?

@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, 22H2 Jan 4, 2022
@alfredneu
Copy link

Hi, the issue is still present and very annoying. Any chance for a fix? As david50407 said, other terminal emulators handle this fine, perhaps you could have a look how they do it.

@zadjii-msft zadjii-msft modified the milestones: 22H2, Backlog Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants