WIP
https://github.com/vim/vim/pull/18575
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Could you consider making it optional?
With location in ~/pack/dist/opt/osc52/plugin/...
we should be able to enable it with packadd osc52
.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Could you consider making it optional?
With location in
~/pack/dist/opt/osc52/plugin/...
we should be able to enable it withpackadd osc52
.
Yes I planned on doing that, I'll change it later
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 3 commits.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
Could anyone test in MacOS? I have added documentation on how to use
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
I think this is ready. I didn't add tests because this plugin is very simple anyways + I can't figure out a way to actually test the plugin
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
did someone try it out? Ping @peterwu who requested this functionality in #14995
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I tested on my MacBook and it didn't seem to work.
packadd osc52
set clipmethod^=osc52
This will print ^[[?1;2c
when launching vim.
5. ~/.vimrc
packadd osc52
g:osc52_force_avail = true
set clipmethod^=osc52
This doesn't print anything when launching vim.
"+yy
, the content is not copied to the + register."*yy
, thee content is copied to the * register but not available in the system clipboard."*p
as it does not paste what's in the system clipboard to the vim session.—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 2 commits.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 0 commits.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.
In all cases, ommiting
g:osc52_force_avail = true
results in some escape chars printed on the terminal before vim shows up.
That is likely from Vim trying to detect if the terminal supports OSC 52, I've made it now that is prints a message while waiting for a response (which may never come)
Ghostty prints ^[[?62;22;52c while kitty prints ^[[?62;52c. And when this happens, the OSC52 function does not work.
Can you elaborate on this? The plugin should match the '52' in those responses and enable the osc52 functionality. Or is it just printing characters to the screen? If so can you try the latest commit?
The following is for my test on Terminal app but the same steps were performed for Ghostty and kitty.
- compiled from https://github.com/64-bitman/vim/tree/osc52_plugin
- make
- make install
- ~/.vimrc
packadd osc52 set clipmethod^=osc52
This will print
^[[?1;2c
when launching vim. 5. ~/.vimrcpackadd osc52 g:osc52_force_avail = true set clipmethod^=osc52
This doesn't print anything when launching vim.
- If I do
"+yy
, the content is not copied to the + register.- If I do
"*yy
, thee content is copied to the * register but not available in the system clipboard.- The same happens to
"*p
as it does not paste what's in the system clipboard to the vim session.
It seems that that the MacOS default terminal does not support OSC52, could you show the value of v:clipmethod
? It looks like iTerm supports OSC 52 so could you try that? Thanks.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I did a git pull off the osc52_plugin, recompiled and discovered a few things.
If g:osc52_force_avail = true
is not set in vimrc, now it prints something like this:
Waiting for OSC 52 response...^[[?64;1;2;4;6;17;18;21;22c
By that, I mean:
packadd osc52
set clipmethod^=osc52
$ vim
Waiting for OSC 52 response...^[[?64;1;2;4;6;17;18;21;22c
~ type :help version9<Enter> for version infoWaiting for OSC 52 response...^[[?64;1;2;4;6;17;18;21;22c
that's right: the Waiting message follows directly after the initial startup message
6. at this stage, I can't fire vim commands, such as i, d, y, p, etc. These keys will be printed right after the Waiting message
7. This stops when I hit ENTER again
8. Now, I use the vim session as usual
So, imo, the updated commits made things even worse. Before the chars were displayed at step3 but after I hit ENTER, it let me use vim without step 6.
I also tested iTerm2, v3.6.4. If I followed the instructions to disable clipboard access, I can copy content to clipboard but cannot paste content from clipboard. I'm not familar with iTerm2 so maybe I didn't figure out a setting somewhere to enable paste.
Another thing that I noticed:
On my MacBook Air running 26.0.1, I was able to compile from source without any issues;
On my MacBook Pro running 26.0.1, I couldn't compile the https://github.com/64-bitman/vim.git (neither master nor osc52_plugin) but I could compile https://github.com/vim/vim.git with no issues.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I gave it a try with Alacritty under Linux and both copy and paste are working fine. Just a small nitpicks: I'm also seeing Waiting for OSC 52 response...^[[?6c
. The message added in the last commits makes clear what's going on, but what about adding a hint that the response may never come and pressing Return forces Vim to continue? Also, why do I need press Return four times until Vim starts? :messages
is empty.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I experience the same issues. However, if I manually run
:packadd osc52
:set clipmethod^=osc52
after vim has already loaded it works as expected. It seems the primary device attributes event isn't get triggered specifically in the context that .vimrc
is loaded, causing Available()
to hang.
One more thing. When pasting a clipboard that has no newlines, it seems a newline is inserted at the end.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.