XSEL(1x)
π XSEL β the manual page, but make it cute
okay bestie, welcome to xsel(1x) β your new favorite lil X selection gremlin π
β¨ NAME β¨
xsel β manipulate the X selection. that's it. that's the whole job. she does one thing and she ATE. π
πΈ SYNOPSIS πΈ
xsel [OPTION]...
π¦ DESCRIPTION π¦
Retrieve and set the X selection. simple on the surface, lowkey unhinged underneath, iykyk π
So here's the tea: the X server keeps three selections, and their names are:
- PRIMARY β the conventionally-used one for copying and pasting with the middle mouse button. this is the main character.
- SECONDARY β less frequently used by application programs π₯²
- CLIPBOARD β also less frequently used by application programs π«Ά
This program operates on the PRIMARY selection unless you say otherwise, bestie.
Now the default behaviour, and listen closely because this is the part everyone gets wrong:
By default, this program outputs the selection without modification if both standard input and standard output are terminals (ttys). Otherwise:
- the current selection is output if standard output is not a terminal (tty), and
- the selection is set from standard input if standard input is not a terminal (tty).
If any input or output options are given, then the program behaves only in the requested mode. no vibes-based guessing, we're being explicit now π
And if both input and output are required? The previous selection is output before being replaced by the contents of standard input. iconic behaviour, honestly.
π Input options
-a,--appendβ append standard input to the selection. Implies-i. π-f,--followβ append to selection as standard input grows. Implies-i. she's watching. respectfully. π-i,--inputβ read standard input into the selection.
π§ Output options
-o,--outputβ write the selection to standard output.
β Action options
-c,--clearβ clear the selection. Overrides all input options. bye bye selection π«‘-d,--deleteβ Request that the current selection be deleted. This not only clears the selection, but also requests to the program in which the selection resides that the selected contents be deleted. Overrides all input options. yeah she's not just clearing, she's asking your source app to delete the text too. aggressive. love that for her. π₯
π Selection options
-p,--primaryβ operate on the PRIMARY selection (default). β¨-s,--secondaryβ operate on the SECONDARY selection.-b,--clipboardβ operate on the CLIPBOARD selection.-k,--keepβ Do not modify the selections, but make the PRIMARY and SECONDARY selections persist even after the programs they were selected in exit. (Conventionally, the CLIPBOARD selection is persisted by a separate special purpose program such asxclipboard(1)). Ignores all input and output options. she stays. π«Ά-x,--exchangeβ exchange the PRIMARY and SECONDARY selections. Ignores all input and output options. swap swap swap π
π X options
--displaydisplayname β specify the server to use; seeX(1).--windowNamewindowName β specify the XWM_NAMEwindow property; default is"xsel".-tms,--selectionTimeoutms β Specify the timeout in milliseconds within which the selection must be retrieved. In--inputmode, the background process exits after this amount of time. A value of0(zero) specifies no timeout (default). β°
π Miscellaneous options
-lfilename,--logfilefilename β Specify the file to log errors to when detached. (Default$HOME/.xsel.log)-n,--nodetachβ Do not detach from the controlling terminal. Without this option,xselwill fork to become a background process in input, exchange and keep modes. no ghosting the terminal today π-h,--helpβ display usage information and exit-v,--verboseβ Print informative messages. Additional instances of-vraise the debugging level, ie. print more information. the more-vs, the more she talks. she's an open book π--versionβ output version information and exit
π NOTES π
There is no X selection buffer. okay? none. stop looking for one, bestie, it's not there.
The selection mechanism in X11 is an interclient communication mediated by the X server each time any program wishes to know the selection contents, eg. to perform a middle mouse button paste.
In order to implement modification of the selection(s) (in input, keep and exchange modes) this program detaches from the terminal, spawning a child process to supply the new selection(s) on demand. This child exits immediately when any other program takes over the selection(s), eg. when the user next selects some text in a terminal window or by running xsel -c. so yeah, she spawns a lil helper and that helper dips the second someone else takes the selection. drama. π
π STANDARDS π
xsel conforms to the Inter-Client Communication Conventions Manual Version 2.0 (ICCCM2). she's certified, she's compliant, she read the docs. periodt. π
π₯ SEE ALSO π₯
X(7), Xserver(1), xset(1), xclipboard(1), xpaste(1)
π AUTHOR π
Conrad Parker <conrad@vergenet.net>, July 2001
and that's the whole thing, bestie π₯Ήβ¨ this page came to you from the January 2008 era of the XSEL(1x) manual β dated, iconic, and still doing the most. go copy something. π
π
π¦ where this page comes from
- alpine 3.24: xsel-doc 1.2.1-r0 Β· MIT
- arch rolling: xsel 1.2.1-2 Β· custom
- debian trixie: xsel 1.2.1-1 Β· X11
- epel 10: xsel 1.2.1-4.el10_0 Β· MIT
- epel 9: xsel 1.2.1-1.el9 Β· MIT
- fedora 43: xsel 1.2.1-9.fc43 Β· HPND-sell-variant
- fedora 44: xsel 1.2.1-10.fc44 Β· HPND-sell-variant
- nixos 26.05: xsel 1.2.1
- nixpkgs unstable: xsel 1.2.1
- ubuntu noble: xsel 1.2.1-1 Β· X11
- ubuntu questing: xsel 1.2.1-1
- ubuntu resolute: xsel 1.2.1-1build1 Β· X11
- ubuntu stonking: xsel 1.2.1-1build1 Β· X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms