OSC52 clipboard in popup windows

50 views
Skip to first unread message

Carl Dong

unread,
Jan 8, 2023, 7:00:50 PM1/8/23
to tmux-...@googlegroups.com
I’m trying to use the relatively new popup window feature, but OSC52 clipboards don’t seem to work. My config has the following lines:

...
set -g set-clipboard on
...
bind t display-popup -E


In a normal non-popup pane, I check my environment:

$ echo $TERM
screen-256color

$ tmux info|grep Ms:
192: Ms: (string) \033]52;%p1%s;%p2%s\a

And the OSC 52 clipboard works great:

$ printf "\033]52;c;$(echo outside | base64)\a”

$ pbpaste
outside

Then, in a popup pane, I check my environment again:

$ echo $TERM
screen-256color

$ tmux info|grep Ms:
192: Ms: (string) \033]52;%p1%s;%p2%s\a

And the OSC 52 clipboard doesn’t work at all:

$ printf "\033]52;c;$(echo inside | base64)\a”

$ pbpaste
printf "\033]52;c;$(echo inside | base64)\a” # This was the last thing I copied

I’m a bit stumped here and would appreciate any guidance

–Carl

Nicholas Marriott

unread,
Jan 8, 2023, 7:08:10 PM1/8/23
to Carl Dong, tmux-users
OSC 52 does not work in popups at the moment.




--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/0F527D61-895C-4526-81BB-837C839B24DE%40carldong.me.

Carl Dong

unread,
Jan 8, 2023, 7:11:22 PM1/8/23
to Nicholas Marriott, tmux-users
How hard would it be to implement support for it? I’m happy to write a patch if pointed in the right direction.

–Carl

Nicholas Marriott

unread,
Jan 8, 2023, 7:19:12 PM1/8/23
to Carl Dong, tmux-users
Look at input.c input_osc_52 at the start it checks wp == NULL which means it needs a pane.

It doesn't use wp until twice at the end of the function. The notify is easy enough, you can just skip it if wp is NULL.

But for the screen_write_start - I'm not sure why it calls screen_write_start/stop rather than using ictx->ctx, so you could maybe try removing them and using that instead of the stack screen_write_ctx.

If that won't work it may be difficult to set up the context because the input code may not have everything it needs. It may mean another callback back to the screen owner.

Carl Dong

unread,
Jan 9, 2023, 2:18:05 AM1/9/23
to Nicholas Marriott, tmux-users
Thanks, will take a look.
Reply all
Reply to author
Forward
0 new messages