Import my usual \dash macro into all these man pages, and use it for
[sgt/utils] / xcopy / xcopy.but
CommitLineData
9acadc2b 1\cfg{man-identity}{xcopy}{1}{2004-08-02}{Simon Tatham}{Simon Tatham}
9acadc2b 2
92dccb8d 3\define{dash} \u2013{-}
4
8a48d402 5\title Man page for \cw{xcopy}
9acadc2b 6
8a48d402 7\U NAME
9acadc2b 8
92dccb8d 9\cw{xcopy} \dash read and write text to/from an X selection from the
9acadc2b 10command line
11
8a48d402 12\U SYNOPSIS
9acadc2b 13
14\c xcopy [ -r ] [ -u | -c ] [ -C ]
15\e bbbbb bb bb bb bb
16
8a48d402 17\U DESCRIPTION
9acadc2b 18
19\cw{xcopy} is a command-line utility for manipulating the X selection.
20
21It has two basic modes. In read mode (\cw{xcopy -r}), it connects to
22your X server, retrieves the contents of the selection as plain
23text, and writes it on standard output. You would then typically
24redirect its output into a file, or pipe it into some other program.
25
26In write mode (just \cw{xcopy}, if \cw{-r} is not specified), it
27will read data from standard input, then connect to your X server
28and place that data in the selection as plain text. So you can pipe
29data into \cw{xcopy}, move to another application, and press Paste.
30
31The X selection model requires the selection-owning client to remain
32connected to the server and hand out its data on request. Therefore,
33\cw{xcopy} in write mode forks off a background process which does
34this. The background process terminates once it is no longer the
35selection owner (i.e. as soon as you select data in another
36application), or if your X session finishes. Normally you can ignore
37its presence, although it might become important to be aware of it
38if (for example) the \cw{xcopy} background process were to be the
39last X client still connected through an SSH tunnel.
40
41\cw{xcopy} currently only handles text data. However, it is capable
42of handling it in the form of plain text, UTF-8, or compound
43(multiple-character-set) text. Use the \cw{-u}, \cw{-c} and \cw{-C}
44options to control this aspect of its behaviour.
45
8a48d402 46\U OPTIONS
9acadc2b 47
48By default (if \cw{-r} is not supplied), \cw{xcopy} operates in
49write mode.
50
51\dt \cw{-r}
52
53\dd Places \cw{xcopy} into read mode.
54
55By default (if neither \cw{-c} nor \cw{-u} is supplied), \cw{xcopy}
56reads and writes the selection using the type \cw{STRING}, which
57means that the input or output data is expected to be encoded in
58ISO-8859-1.
59
60\dt \cw{-u}
61
62\dd In read mode, causes \cw{xcopy} to request the selection using
63the type \cw{UTF8_STRING}, which typically means that the returned
64data will be encoded as UTF-8. In write mode, causes \cw{xcopy} to
65\e{give out} the selection as type \cw{UTF8_STRING}, meaning that
66the data piped in to it is expected to be encoded as UTF-8.
67
68\dt \cw{-c}
69
70\dd Similar to \cw{-u}, but uses the type \cw{COMPOUND_TEXT} rather
71than \cw{UTF8_STRING}. \cw{COMPOUND_TEXT} is a complex
72multi-character-set encoding similar to ISO 2022, and is unlikely to
73be a very useful form in which to pass data to or from non-X
74programs. However, it might occasionally be useful to retrieve a
75compound text selection using \cw{xcopy -r -c}, and later on return
76it to the X selection using \cw{xcopy -c} so it can be pasted back
77into a different application.
78
79In write mode, if \cw{xcopy} is operating in \cw{STRING} mode and a
80pasting application requests the selection as \cw{COMPOUND_TEXT},
81\cw{xcopy} will convert the data automatically. This is normally
82what you want.
83
84\dt \cw{-C}
85
86\dd Suppresses conversion to compound text in write mode. This is
87occasionally useful if you are pasting control characters, since the
88compound text specification forbids any control characters and the
89Xlib conversion functions honour this. If you are (for example)
90trying to paste a sequence of editor commands into a terminal
91window, you might well want to paste a string full of escape
92sequences and control characters, in which case you may need to use
93\cw{-C} to disable conversion to compound text.
94
5e36d477 95\dt \cw{-b}
96
97\dd Causes \cw{xcopy} to read or write the clipboard instead of the
98selection. (Modern GNOME and KDE-style programs can often interact
99with both. The \e{selection} is the traditional X-style storage
100location which you typically copy things into just by selecting them
101with the mouse, and paste with the middle mouse button. The
102\e{clipboard} is a more Windows-like location which you access using
103explicit Cut, Copy and Paste commands in your application.)
104
3ffcf184 105\dt \cw{-t}
106
107\dd Causes \cw{xcopy}, in read mode only, to return the list of
108possible target types currently stored in the selection. This is
109probably only useful for debugging X applications or X selection
110issues.
111
112\dt \cw{-T}
113
114\dd Causes \cw{xcopy}, in read mode only, to return the time stamp
115for the current selection. This is probably only useful for
116debugging X applications or X selection issues.
117
118\dt \cw{-a} \e{target atom}
119
120\dd Causes \cw{xcopy}, in read mode only, to return the selection
121contents corresponding to some particular user-specified target
122type. The target type can be anything listed by \cq{xcopy -r -t}.
123
a3256cf7 124\dt \cw{-v}
125
126\dd Causes \cw{xcopy}, in read mode only, to produce a verbose
127commentary on the progress of reading the X selection. Can be useful
128for debugging interactions with other programs.
129
3d2a141c 130\dt \cw{-F}
9acadc2b 131
10afc53f 132\dd Causes \cw{xcopy} not to fork, when in write mode. Instead the
133original \cw{xcopy} process will continue to run until the selection
134is taken away from it. Probably only useful when debugging
135\cw{xcopy} itself, although it's just possible that it might turn
136out to be useful for some other special purpose (e.g. having the
137process waiting for it know when the selection owner has changed).
138
3d2a141c 139\dt \cw{-d} \e{size}
140
141\dd Alters the maximum size of data transferred in one lump by
142\cw{xcopy}. (Probably most useful for diagnostic purposes.)
143
144\dt \cw{-I}
145
146\dd Inhibits \cw{xcopy}, in write mode, from using the \cw{INCR}
147mechanism for transferring large amounts of selection data a piece at
148a time and waiting for the recipient to acknowledge each chunk before
149sending the next. (Just in case a client doesn't support it.)
150
151\dt \cw{-B}
152
153\dd Inhibits \cw{xcopy}, in write mode, from storing its data in the
154persistent \q{cut buffers} on the root window as well as using the
155peer-to-peer selection mechanism.
156
10afc53f 157\U BUGS
9acadc2b 158
159Automatic conversion between compound text and UTF-8 is not
160currently supported. There are Xlib functions to do it, although
161they don't appear to work very well (missing out many characters
162which they could have converted).
da0f8522 163
8a48d402 164\U LICENCE
da0f8522 165
166\cw{xcopy} is free software, distributed under the MIT licence. Type
167\cw{xcopy --licence} to see the full licence text.
1166ff62 168
169\versionid $Id$