Alacritty: selection.copy_to_clipboard option not respected on Windows

Created on 2 Jul 2019  路  3Comments  路  Source: alacritty/alacritty

On Windows the select-to-copy feature doesn't work. From digging through the code (alacritty_terminal/src/clipboard.rs) it looks like because there is no concept of a "selection" keyboard on windows, Alacritty decides it should not store the selection text.

I'm sure this used to work, I found it really useful. Might be a new breakage since the refactoring to copypasta / removal of xclip?

I'm wiling to prepare a PR to fix this. I think there's two possible ways to go:

  1. Make platforms without a selection clipboard (Windows, MacOS) use the primary clipboard always. (I believe this is what the behaviour used to be.)
  2. Or, add a new selection.use_primary_clipboard option which redirects all stores/loads from the selection clipboard to the primary clipboard.

My personal feeling is that on platforms without a selection clipboard, it makes sense to just use the primary clipboard if selection.copy_to_clipboard is set to true. So I prefer option 1, rather than introducing another configuration option.

Which way do you prefer? I will then create a PR accordingly.

F - not a bug

Most helpful comment

Argh, really embarrassingly - while digging around to debug I realised the option is called save_to_clipboard, not copy_to_clipboard!

I can confirm once I have the correct option in my config everything works as expected.

Closing as nothing to do here!

All 3 comments

On Linux, things are copied to the clipboard regardless of the copy_to_clipboard option. This option is specifically about enabling this on macOS and Windows, which both do not support the selection clipboard unfortunately.

So with this option set, it should get stored to the primary clipboard (since that's basically the only option).

Cool - I'll put together a PR in the coming days!

Argh, really embarrassingly - while digging around to debug I realised the option is called save_to_clipboard, not copy_to_clipboard!

I can confirm once I have the correct option in my config everything works as expected.

Closing as nothing to do here!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kekePower picture kekePower  路  3Comments

renannprado picture renannprado  路  3Comments

asilvadesigns picture asilvadesigns  路  3Comments

paupalou picture paupalou  路  3Comments

topaxi picture topaxi  路  3Comments