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

Figure out if / how OSC52 paste could work #48

Open
janlelis opened this issue Apr 8, 2024 · 1 comment
Open

Figure out if / how OSC52 paste could work #48

janlelis opened this issue Apr 8, 2024 · 1 comment
Labels
Clipboard Implementation Another clipboard implementation / provider / platform

Comments

@janlelis
Copy link
Owner

janlelis commented Apr 8, 2024

No description provided.

@janlelis janlelis added the Clipboard Implementation Another clipboard implementation / provider / platform label Apr 8, 2024
@korbin
Copy link

korbin commented Feb 13, 2025

This works, FYI:

def paste
  data = String.new

  STDIN.raw(intr: true) do |stdin|
    print "\033]52;p;?\007"

    loop do
      char = stdin.getc
      break if data.length > 0 && (char == "\a" || char == "\x1b")
      data << char
    end
  end

  Base64.strict_decode64(data[6..-1]) if data.start_with?("\033]52;")
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clipboard Implementation Another clipboard implementation / provider / platform
Projects
None yet
Development

No branches or pull requests

2 participants