Skip to content

Gitlinker won't copy to OSC52 #291

@hqkhan

Description

@hqkhan

Hey, for some reason, gitlinker now refuses to copy lines or files to clipboard. My config hasn't changed in a while. Used to work fine, now it doesn't copy anymore :(. I do have custom routers that I can't share but this is essentially the setup:

return {
  "linrongbin16/gitlinker.nvim",
  cmd = "GitLink",
  opts = {},
  keys = {
    {
      "<leader>gy",
      function()
        require("gitlinker").link({
          file = file_on_bcommit(),
          rev = rev_on_bcommit(),
          remote = get_remote(),
        })
      end,
      mode = { "n", "v" },
      desc = "Yank git link or fzf-lua bcommit"
    },
  },
  config = function(opts)
    opts = opts or {}
    opts.debug = true
    opts.file_log = true
    opts.router = {
      browse = {
        ["^...] = _router
      },
      file_only = {
        ["^..."] = _router_file_only
      },
    }
    require "gitlinker".setup(opts)
  end
}

When I hit my hotkey, I do see it in :messages and the URL looks correct but it doesn't automatically copy it. What am I missing?

It doesn't work on repos that are not from my work either.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions