Skip to content

fix: paste image from clipboard text/uri-list for X11#762

Draft
mputz86 wants to merge 1 commit intoobsidian-nvim:mainfrom
mputz86:main
Draft

fix: paste image from clipboard text/uri-list for X11#762
mputz86 wants to merge 1 commit intoobsidian-nvim:mainfrom
mputz86:main

Conversation

@mputz86
Copy link
Copy Markdown

@mputz86 mputz86 commented Mar 18, 2026

This fixes the pasting of images, from the clipboard, which are kept in the clipboard as text/uri-list, for X11.

There is an implementation for Wayland with wl-paste and wl-copy, but not for xclip.

PR Checklist

  • The PR contains a description of the changes
  • I read the [CONTRIBUTING.md] file
  • The CHANGELOG.md is updated
  • The changes are documented in the README.md file
  • The code complies with make chores (for style, lint, types, and tests)

@mputz86
Copy link
Copy Markdown
Author

mputz86 commented Mar 18, 2026

having said all this, I know this PR still lacks/has some issues:

  • The run of make chores fails locally, despite only warning in non-touched files are reported
  • I have no clue what should be updated in the README.md
  • There are no tests (also not for the Wayland case, afaik); how to best add some?
  • I have not opened an Issue, since I kind of thought that fix needs no discussion "on the if-side" (but maybe on the "how" side)
  • I don't like the Wayland implementation with the shell-pipe very much, but aligned with it for consistency for now...

I am also unsure if I am heard here :D.

@neo451
Copy link
Copy Markdown
Member

neo451 commented Mar 19, 2026

yes you are definitely heard :)

nice fix, indeed a hole in the implementation

  1. the make chores is going through some transition so it's ok to fail
  2. no need to change the readme
  3. I don't like the pipe approach as well, we should use more modern approach like vim.system to spawn the xclip and just process the results in lua instead of shell commands.
  4. no issue is ok
  5. tests is a bit tricky, since we need some helper to put some image to clipboard? than is also like differs by platform, but in the end we would also like to implement some thing like :Obsidian copy to copy text/image/attachment smartly, so we do need the handlers for putting stuff into clipboard, so it would be cool if you also just draft a xclip handler to put a tmp image into the clipboard and tests from that, and make the test only run in x11, or welcome other ideas for mocking this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants