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

Space/newline characters are copied when selected #2957

Closed
poliorcetics opened this issue Jul 4, 2022 · 4 comments
Closed

Space/newline characters are copied when selected #2957

poliorcetics opened this issue Jul 4, 2022 · 4 comments
Labels
C-bug Category: This is a bug

Comments

@poliorcetics
Copy link
Contributor

Summary

When displayed, the space/tabs/newline/nbsp characters interfere with URL recognition, OS copy/paste:

URL recognition take into account the newline character:

Screenshot 2022-07-04 at 15 14 53

OS copy then paste (not with space + y but with Command + C on macOS) also gets them:

First copying

Screenshot 2022-07-04 at 15 17 32

Then pasting

Screenshot 2022-07-04 at 15 17 46

Reproduction Steps

I tried this:

  1. hx
  2. :set-option whitespace.render all
  3. :set-option mouse false
  4. Write // See https://gitlab.company.com/company/project/-/issues/42, add newline, exit insert mode
  5. Click on URL, it will take the newline character
  6. Copy / See http with the OS select and copy (with mouse and Command + C)
  7. Paste somewhere else

I expected this to happen:

The virtual characters are not copied

Instead, this happened:

The virtual characters are copied

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

macOS

Terminal Emulator

kitty 0.25.2

Helix Version

helix 22.05 (e58d28a)

@poliorcetics poliorcetics added the C-bug Category: This is a bug label Jul 4, 2022
@the-mikedavis
Copy link
Member

I don't think this is possible to fix and the same thing happens in vim and kakoune. The terminal doesn't have a concept of virtual text afaik so there's no way for us to render whitespace text so that it isn't part of the URL.

@kirawi kirawi closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2022
@kirawi
Copy link
Member

kirawi commented Jul 4, 2022

You can use space y to copy instead.

@kovidgoyal
Copy link

Sure you can fix it using OSC 8 to mark hyperlinks.

@kirawi
Copy link
Member

kirawi commented Jul 5, 2022

#1472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants