xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.43k stars 180 forks source link

Unable to Add Images to nb using Clipboard in Windows-WSL Environment #322

Open selmaohneh opened 2 weeks ago

selmaohneh commented 2 weeks ago

Issue Title

Unable to Add Images to nb using Clipboard in Windows-WSL Environment

Issue Description

I am currently working in a Windows environment, utilizing Windows Subsystem for Linux (WSL) and am encountering issues when trying to add images directly from the clipboard to nb.

My workflow involves capturing images with the Windows Snipping Tool, where there is an option to copy the image directly to the clipboard. However, when attempting to add these images to nb using the clip plugin, I am met with the following error:

Error: Can't open display: (null)  
Added: [118] 🌄 20240614114257.jpg  

The image appears to be added but the file size is 0B, and it cannot be opened.

I am looking for a solution or workflow that would allow me to add images directly from the clipboard, without the need to first save these images to disk.

Environment

Steps to Reproduce

  1. Capture image using Windows Snipping Tool.
  2. Copy the captured image to clipboard.
  3. Attempt to add the image to nb using the clip plugin (nb clip sampleimage .png).

Expected Behavior

The image should be successfully added to nb and should be viewable/openable.

Actual Behavior

An error message is received and the image added to nb has a file size of 0B, making it unviewable/unopenable.

I would appreciate any guidance or insights into how I might resolve this issue. Thanks in advance!