public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Backwoods BC <completely.and.totally.trash@gmail.com>
To: cygwin@cygwin.com
Subject: Re: substitute for xclip?
Date: Thu, 20 Oct 2022 01:12:11 -0700	[thread overview]
Message-ID: <CAKwdsS-Yd+YdEtn-S1Qv1a44ggJpH=UpeKb1PxEAVkHP=9xkOA@mail.gmail.com> (raw)
In-Reply-To: <ff0483b8-f052-c927-5e8a-ea12a6d33f7b@gmx.com>

On Thu, Oct 20, 2022 at 12:27 AM Sam Edge <sam.edge.cygwin@gmx.com> wrote:
> On 19/10/2022 23:52, Oliver Schoede wrote:
> > Hi!
> >
> > On Wed, 19 Oct 2022 14:58:42 +0200
> > Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:
> >> https://fex.rus.uni-stuttgart.de/fop/jFZ6T7wI/X-20221019141237.png
> >>
> >> 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.

  reply	other threads:[~2022-10-20  8:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  6:58 Ulli Horlacher
2022-10-19  7:44 ` Sam Edge
2022-10-19  7:54   ` Sam Edge
2022-10-19  9:01 ` Backwoods BC
2022-10-19 11:56   ` Sam Edge
2022-10-19 12:58   ` Ulli Horlacher
2022-10-19 22:52     ` Oliver Schoede
2022-10-20  7:27       ` Sam Edge
2022-10-20  8:12         ` Backwoods BC [this message]
2022-10-20  3:23   ` Thomas Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwdsS-Yd+YdEtn-S1Qv1a44ggJpH=UpeKb1PxEAVkHP=9xkOA@mail.gmail.com' \
    --to=completely.and.totally.trash@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).