substitute for xclip?

Backwoods BC
Thu Oct 20 08:12:11 GMT 2022

On Thu, Oct 20, 2022 at 12:27 AM Sam Edge <> wrote:
> On 19/10/2022 23:52, Oliver Schoede wrote:
> > Hi!
> >
> > On Wed, 19 Oct 2022 14:58:42 +0200
> > Ulli Horlacher <> wrote:
> >>
> >>
> >> I have selected [copy] in the file browser, but /dev/clipboard is
> >> empty. Also getclip gives me no output.
> >>
> >
> > It looks to me like you copied the file, not the file name?
> >
> To clarify the above, Windows has a non-text clipboard data type when
> 'copying' a file in the File Explorer which encodes additional
> information other than its path. This is to allow the equivalent 'paste'
> function in Explorer and other file-accepting GUI applications to work
> more intelligently. Unfortunately, Cygwin's /dev/clipboard and
> get/putclip only process text formats.
> I imagine your X file manager is simply copying a textual representation
> of the file path to the clipboard when you choose 'copy' which of course
> can be extracted by scripts etc. It appears that Windows Explorer
> doesn't also place a textual representation onto the clipboard (the
> Windows clipboard allows multiple representations to exist
> simultaneously) which is what would be required for Cygwin to use it at
> present.
> --
> Sam Edge

You can force Windows Explorer to copy the path by doing
SHIFT-RightClick on the filename and selecting "Copy as path."

The next hurdle that you'll run into is that the clipboard contents
will be in Windows/DOS format (c:\folder\filename) while Cygwin will
most often expect it in *nix format (cygdrive/c/folder.filename).
'cygpath' is your friend. Sometimes (not clear exactly when) Cygwin
will accept the Windows path, but I always convert it to *nix format
to avoid unpleasant surprises later.

More information about the Cygwin mailing list