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 = trueresults 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^=osc52This will print
^[[?1;2cwhen launching vim. 5. ~/.vimrcpackadd osc52 g:osc52_force_avail = true set clipmethod^=osc52This 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
"*pas 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.![]()
Currently waiting for these two PRs to be merged. #18660 #18642
—
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.![]()
@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.![]()
@chrisbra commented on this pull request.
In src/term.c:
> @@ -5683,7 +5683,7 @@ handle_csi( (char_u *)"da1", NULL, FALSE, curbuf); key_name[0] = (int)KS_EXTRA; - key_name[1] = (int)KE_IGNORE; + key_name[1] = (int)KE_CSI;
this change looks suspicious. Why is this needed?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
thanks. Are you able to create a simple test for this plugin?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks. Are you able to create a simple test for this plugin?
I plan to
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman commented on this pull request.
In src/term.c:
> @@ -5683,7 +5683,7 @@ handle_csi( (char_u *)"da1", NULL, FALSE, curbuf); key_name[0] = (int)KS_EXTRA; - key_name[1] = (int)KE_IGNORE; + key_name[1] = (int)KE_CSI;
So that the we can wait for a da1 terminal sequence response using getchar.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 12 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman commented on this pull request.
In src/term.c:
> @@ -5683,7 +5683,7 @@ handle_csi( (char_u *)"da1", NULL, FALSE, curbuf); key_name[0] = (int)KS_EXTRA; - key_name[1] = (int)KE_IGNORE; + key_name[1] = (int)KE_CSI;
Actually I've decided to go another way, so this change isn't necessary anymore
—
Reply to this email directly, view it on GitHub, or unsubscribe.
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.![]()
@peterwu @alex-huff @Yamagi Can you guys test out the plugin again? Note that on Windows terminal in Powershell (and other conpty shells), It seems that Vim cannot detect OSC 52 support, so you must force enable it. Thanks.
—
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.![]()
@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.![]()
I gave it a try under Alacritty and tmux running in Alacritty. Both require g:osc52_force_avail = true, otherwise OSC52 support isn't detected. I guess this is caused by by both Alacritty and tmux not including OSC52 in their DA1 response. The doku is clear on it, so this shouldn't be a problem.
tmux just works, both for copying and for pasting.
Alacritty is a little bit strage. The moment I press " the message '' appears in the status line. I need to press CTRL-C two times to ge rid of it. OSC52 isn't working afterwards, with is kind of excepted given that the DA1 query was never answered. However the old oscyank plugin - https://github.com/ojroques/vim-oscyank - which doesn't rely on DA1 just works fine.
I would suggest that setting g:osc52_force_avail = true prevent the plugin from ever sending a DA1 query.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Alacritty is a little bit strage. The moment I press
"the message 'Waiting for OSC52 response... Press CTRL-C to quit' appears in the status line. I need to press CTRL-C two times to ge rid of it. OSC52 isn't working afterwards, with is kind of excepted given that the DA1 query was never answered. However the old oscyank plugin - https://github.com/ojroques/vim-oscyank - which doesn't rely on DA1 just works fine.
Can you show a video of that happening? I cannot reproduce that in Alacritty. Thanks
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 17 commits.
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 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.![]()
Can you show a video of that happening using the latest commit in this PR? I cannot reproduce that in Alacritty. Thanks
After some fiddling around I realized that it's caused by peekaboo: https://github.com/junegunn/vim-peekaboo Removing the plugin make thinks work.
Bildschirmaufnahme_20251214_084525.webm
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I think this is ready
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks, note the test fails on the FreeBSD CI runner, so I have disabled it for BSD for now. I suppose the terminal in the CI does not support OSC52?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks, note the test fails on the FreeBSD CI runner, so I have disabled it for BSD for now. I suppose the terminal in the CI does not support OSC52?
It shouldn't be failing. The macos test seems to be failing as well. I will create a PR to fix this soon.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()