public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* looking for xcp and/or wxcopy?
@ 2019-08-21 19:50 L A Walsh
  2019-08-22  6:29 ` Hans-Bernhard Bröker
  0 siblings, 1 reply; 5+ messages in thread
From: L A Walsh @ 2019-08-21 19:50 UTC (permalink / raw)
  To: cygwin

did an apropos for something to help me debug a copy/paste problem:

> apropos cut|grep -iP 'copy|paste'
and found (among others)
wxcopy (1x)          - copy stdin or file into cutbuffer
wxpaste (1x)         - output a cutbuffer to stdout
xcb (1x)             - X Cut Buffers - Pigeon holes for your cut and
paste se...
---
but when I try to execute or find them they aren't
found.

Tried looking in setup.exe's search as well, but no go.

Seems odd that all of them would be gone.

Anyone know of a util that can display your select,cut and paste
buffs?

(  For some reason I started having problems select/cut from gvim
  (displayed on local cygwin X), to other windows apps.

  This used to work, BTW, in my .gvimrc, I have the line:
  set clipboard=unnamed,autoselect
)

Thanks!




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: looking for xcp and/or wxcopy?
  2019-08-21 19:50 looking for xcp and/or wxcopy? L A Walsh
@ 2019-08-22  6:29 ` Hans-Bernhard Bröker
  2019-08-22 10:42   ` L A Walsh
  0 siblings, 1 reply; 5+ messages in thread
From: Hans-Bernhard Bröker @ 2019-08-22  6:29 UTC (permalink / raw)
  To: cygwin

Am 21.08.2019 um 21:39 schrieb L A Walsh:

>> apropos cut|grep -iP 'copy|paste'
> and found (among others)
> wxcopy (1x)          - copy stdin or file into cutbuffer
> wxpaste (1x)         - output a cutbuffer to stdout
> xcb (1x)             - X Cut Buffers - Pigeon holes for your cut and
> paste se...
> ---
> but when I try to execute or find them they aren't
> found.

So have you run cygcheck on the packages that are supposed to contain
them?  "cygcheck -p wxcopy" tells me that the former are part of the
WindowMaker package.

xcb appears to not exist at all in current cygwin.  So wherever that man
page was picked up from, I suspect that's not even part of Cygwin.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: looking for xcp and/or wxcopy?
  2019-08-22  6:29 ` Hans-Bernhard Bröker
@ 2019-08-22 10:42   ` L A Walsh
  2019-08-22 16:21     ` looking for xcb " Brian Inglis
  2019-08-22 18:03     ` Brian Inglis
  0 siblings, 2 replies; 5+ messages in thread
From: L A Walsh @ 2019-08-22 10:42 UTC (permalink / raw)
  To: cygwin

On 2019/08/21 15:21, Hans-Bernhard Bröker wrote:
> So have you run cygcheck on the packages that are supposed to contain
> them?  "cygcheck -p wxcopy" tells me that the former are part of the
> WindowMaker package.
>   
Yes...but i started with xcb.  When I saw it missing, I didn't bother
to test the next one

Not sure where it would have come from  weird.
Thanks for the clarification!



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: looking for xcb and/or wxcopy?
  2019-08-22 10:42   ` L A Walsh
@ 2019-08-22 16:21     ` Brian Inglis
  2019-08-22 18:03     ` Brian Inglis
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2019-08-22 16:21 UTC (permalink / raw)
  To: cygwin

On 2019-08-22 01:24, L A Walsh wrote:
> On 2019/08/21 15:21, Hans-Bernhard Bröker wrote:
>> So have you run cygcheck on the packages that are supposed to contain
>> them?  "cygcheck -p wxcopy" tells me that the former are part of the
>> WindowMaker package.
>>   
> Yes...but i started with xcb.  When I saw it missing, I didn't bother
> to test the next one
> 
> Not sure where it would have come from  weird.
> Thanks for the clarification!

It doesn't help that now libxcb1 is the "X Protocol C-Language Bindings (core
runtime)".

There is /dev/clipboard and packages xclip, xclipboard, xwinclip.

There are escape sequences you can generate to get/set X term cut buffers; see:

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands

and scroll down to 5 2:

...
Operating System Commands

OSC Ps ; Pt BEL {\E]Ps;Pt\a}

OSC Ps ; Pt ST  {\E]Ps;Pt\E\\ - string terminator used with string data args}
...
            Ps = 5 2  -> Manipulate Selection Data.  These controls may
          be disabled using the allowWindowOps resource.  The parameter
          Pt is parsed as
               Pc ; Pd

{\E]52;Pc;Pd\a}
{\E]52;Pc;Pd\E\\}

          The first, Pc, may contain zero or more characters from the
          set c , p , q , s , 0 , 1 , 2 , 3 , 4 , 5 , 6 , and 7 .  It is
          used to construct a list of selection parameters for clip-
          board, primary, secondary, select, or cut buffers 0 through 7
          respectively, in the order given.  If the parameter is empty,
          xterm uses s 0 , to specify the configurable primary/clipboard
          selection and cut buffer 0.

          The second parameter, Pd, gives the selection data.  Normally
          this is a string encoded in base64 (RFC-4648).  The data
          becomes the new selection, which is then available for pasting
          by other applications.

          If the second parameter is a ? , xterm replies to the host
          with the selection data encoded using the same protocol.  It
          uses the first selection found by asking successively for each
          item from the list of selection parameters.

          If the second parameter is neither a base64 string nor ? ,
          then the selection is cleared.
...

Use the first command format to get the buffer contents, response is the same as
the second command format, which returns the buffer contents in base 64 encoded
format:
	\E]52;[cpqs0-7];?\a
	\E]52;[cpqs0-7];<b64...>\E\\

For security, mintty requires config entry AllowSetSelection=true to enable
this; others may also have added guards.

I have found it useful to wrap these kinds of commands in bash shell functions,
and use bash "read -p prompt [-d delim] [-[nN] nchars] [-t timeout] response"
when there are responses, to send the escape sequence as a prompt, using what
they call ANSI escape quoting $'\...' for the prompt string, and read the
response, decoding it with shell substitutions: ${response#...} ${response%...},
displaying it with cat -A <<< "$response".
If no unique terminator ends the response so you can use the -d delim, you can
use -N n with a large enough size for any likely response (maybe 4K or higher
for buffers) and -t 1 to return the response after a second.
YMMV

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: looking for xcb and/or wxcopy?
  2019-08-22 10:42   ` L A Walsh
  2019-08-22 16:21     ` looking for xcb " Brian Inglis
@ 2019-08-22 18:03     ` Brian Inglis
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2019-08-22 18:03 UTC (permalink / raw)
  To: cygwin

On 2019-08-22 01:24, L A Walsh wrote:
> On 2019/08/21 15:21, Hans-Bernhard Bröker wrote:
>> So have you run cygcheck on the packages that are supposed to contain
>> them?  "cygcheck -p wxcopy" tells me that the former are part of the
>> WindowMaker package.
>>   
> Yes...but i started with xcb.  When I saw it missing, I didn't bother
> to test the next one
> 
> Not sure where it would have come from  weird.
> Thanks for the clarification!

It doesn't help that now libxcb1 is the "X Protocol C-Language Bindings (core
runtime)".

There is /dev/clipboard and packages xclip, xclipboard, xwinclip.

There are escape sequences you can generate to get/set X term cut buffers; see:

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands

and scroll down to 5 2:

...
Operating System Commands

OSC Ps ; Pt BEL {\E]Ps;Pt\a}

OSC Ps ; Pt ST  {\E]Ps;Pt\E\\ - string terminator used with string data args}
...
            Ps = 5 2  -> Manipulate Selection Data.  These controls may
          be disabled using the allowWindowOps resource.  The parameter
          Pt is parsed as
               Pc ; Pd

{\E]52;Pc;Pd\a}
{\E]52;Pc;Pd\E\\}

          The first, Pc, may contain zero or more characters from the
          set c , p , q , s , 0 , 1 , 2 , 3 , 4 , 5 , 6 , and 7 .  It is
          used to construct a list of selection parameters for clip-
          board, primary, secondary, select, or cut buffers 0 through 7
          respectively, in the order given.  If the parameter is empty,
          xterm uses s 0 , to specify the configurable primary/clipboard
          selection and cut buffer 0.

          The second parameter, Pd, gives the selection data.  Normally
          this is a string encoded in base64 (RFC-4648).  The data
          becomes the new selection, which is then available for pasting
          by other applications.

          If the second parameter is a ? , xterm replies to the host
          with the selection data encoded using the same protocol.  It
          uses the first selection found by asking successively for each
          item from the list of selection parameters.

          If the second parameter is neither a base64 string nor ? ,
          then the selection is cleared.
...

Use the first command format to get the buffer contents, response is the same as
the second command format, which returns the buffer contents in base 64 encoded
format:
	\E]52;[cpqs0-7];?\a
	\E]52;[cpqs0-7];<b64...>\E\\

For security, mintty requires config entry AllowSetSelection=true to enable
this; others may also have added guards.

I have found it useful to wrap these kinds of commands in bash shell functions,
and use bash "read -p prompt [-d delim] [-[nN] nchars] [-t timeout] response"
when there are responses, to send the escape sequence as a prompt, using what
they call ANSI escape quoting $'\...' for the prompt string, and read the
response, decoding it with shell substitutions: ${response#...} ${response%...},
displaying it with cat -A <<< "$response".
If no unique terminator ends the response so you can use the -d delim, you can
use -N n with a large enough size for any likely response (maybe 4K or higher
for buffers) and -t 1 to return the response after a second.
YMMV

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-22 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 19:50 looking for xcp and/or wxcopy? L A Walsh
2019-08-22  6:29 ` Hans-Bernhard Bröker
2019-08-22 10:42   ` L A Walsh
2019-08-22 16:21     ` looking for xcb " Brian Inglis
2019-08-22 18:03     ` Brian Inglis

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).