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

Simulate primary selection inside kitty for macOS #1390

Closed
bfad opened this issue Feb 17, 2019 · 12 comments
Closed

Simulate primary selection inside kitty for macOS #1390

bfad opened this issue Feb 17, 2019 · 12 comments

Comments

@bfad
Copy link

bfad commented Feb 17, 2019

The Terminal application on macOS has a "Paste Selection" feature that works a lot like Linux's primary selection feature except that it's limited to within Terminal itself. Here's how it works: If the current window has a selection, it pastes that selection even if something else was selected more recently. Otherwise it pastes the last thing that was selected even if it is no longer selected.

I would like to take a stab at adding this feature, but thought it might be controversial. If I worked on creating it, would you consider adding it to kitty?

@kovidgoyal
Copy link
Owner

See copy_on_select in kitty.conf.

@bfad
Copy link
Author

bfad commented Feb 17, 2019

That doesn't help as it puts the text in my clipboard, and the point is that I don't want the text in my clipboard.

@Luflosi
Copy link
Contributor

Luflosi commented Feb 17, 2019

I can confirm that "Paste Selection" does the same thing as pasting from clipboard on macOS.

@kovidgoyal
Copy link
Owner

I dont really see the point of making sleections work only within the terminal. It would be very confusing if I got used to using selections to paste inside the terminal but had to remember to use the clipboard shortcuts to paste anywhere else.

@bfad
Copy link
Author

bfad commented Feb 18, 2019

It might be confusing if you're used to having X11's primary selection. I've been using this feature since they added it, and it's always made sense to me. What doesn't make sense to me is the default kitty experience on macOS for paste selection: instead of pasting the text I have selected it pastes from my clipboard! I could turn on auto copying to my clipboard on select, but even you note that's a security risk.

I'm not asking you to create this feature, but if I work on making the experience of paste_from_selection for macOS users something more akin to what they're used to, would you merge it?

@kovidgoyal
Copy link
Owner

Sorry, no. Having selections paste in the terminal but not elsewhere
does not make sense to me.

@Luflosi
Copy link
Contributor

Luflosi commented Feb 18, 2019

I don't expect you to change this and I don't really care about this feature but I'd like you to know that when I first read about paste_from_selection, I thought it would paste what was currently selected. And there are a few other instances where kitty is the only program with a certain behavior, the window title in the menu bar is one example. But if you don't want to change what paste_from_selection does, that's ok for me.

@kovidgoyal
Copy link
Owner

Umm it does paste what is currently selected, provided you turn on
copy_on_select.

@bfad
Copy link
Author

bfad commented Feb 18, 2019

If copy_on_select is on, why would I use paste_from_selection over paste_from_clipboard? The whole point is that I want to create an actual paste_from_selection feature that is congruent with macOS. Your response is that it's fine for X11 / Linux to have a separate paste_from_selection feature that works in a way that is congruent with its system and makes sense to you, but it's not OK for macOS to have that feature in a way that's congruent with that system because it doesn't make sense to you. That's fine, this is your project, but copy_on_select is a completely different feature from being able to actually paste_from_selection without touching the clipboard.

@kovidgoyal
Copy link
Owner

Once again, it makes no sense to me to have a paste_from_selection that
works only inside a single program. It is inconsistent and confusing.
Apple chose not to implement pasting from selection on their OS.
copy_on_select is about the extent of hacky workarounds I am willing to
entertain for that choice.

paste_from_selection exists because of X11, if it makes you feel any
better, I am happy to completely remove it from kitty on macOS.

@kovidgoyal
Copy link
Owner

Actually there is one way I can see this working. Implementing support for multiple copy paste buffers in kitty, just as in vim. One of those buffers can then be for the selection, so you will get your application private selection and paste behavior indirectly.

@bfad
Copy link
Author

bfad commented Feb 20, 2019

I really like this idea of being able to create an arbitrary number of private paste buffers as opposed to just one for the current selection. Thanks for adding the ability to use it on selection.

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

No branches or pull requests

3 participants