XSCOPE(1)
π XSCOPE β bestie edition π
okay so. xscope is the X Window Protocol Viewer, and it's literally the nosiest little program you'll ever meet (affectionate). It's a General Commands Manual situation, and it's giving main character energy in your terminal. Let's go. β¨
πΈ NAME πΈ
xscope β X Window Protocol Viewer
π¦ SYNOPSIS π¦
xscope [-i<in-port>] [-o<out-port>] [-h<server-host>] [-d<display-number>] [-f<filename>] [-I] [-S<n>] [-T] [-A] [-a<level>] [-n<server-host>] [-D<level>] [-q] [-r] [-v<level>] [-V] [-t]
β¨ DESCRIPTION β¨
ngl, xscope is the ultimate middle-man. It sits in-between an X11 client and an X11 server and prints out the contents of every single request, reply, error, or event that gets communicated between them. Like, it reads their texts. All of them. π±
xscope can decode the core X11 protocol and several extensions, including BIG-REQUESTS, DAMAGE, LBX, MIT-SHM, NCD-WinCenterPro, RANDR, and RENDER. This info is genuinely useful for debugging and performance tuning of X11 servers and clients. It's giving diagnostic icon behavior. π₯
To operate, xscope must know the host, port, and display to use to connect to the X11 server. On top of that, it has to know the port on which it should listen for X11 clients. Two cases are common:
(1) The X11 server is on the same host as xscope.
- In this case, the input port for
xscopeshould be selected as an X11 server on a different display, and the clientDISPLAYargument adjusted to selectxscope. For example, if the X11 server is on port 6001, display 1, thenxscopecan use port 6002 as its input port. The client can use display 1 for direct access to X11 or display 2 for access toxscope.
(2) The X11 server is on a different host than xscope.
- In this case the same input and output ports can be used, and the host component of the
DISPLAYis used to selectxscopeor X11.
π ARGUMENTS π
-i<in-port>β Specify the port thatxscopewill use to take requests from clients (defaults to1). For X11, this port is automatically biased by 6000. π₯-o<output-port>β Determines the port thatxscopewill use to connect to X11 (defaults to0). For X11, this port is automatically biased by 6000. π€-h<host>β Determines the host thatxscopewill use to find its X11 server. π-d<display-number>β Defines the display number. The display number is added to the input and output port to give the actual ports which are used byxscope. π₯οΈ-f<filename>β Instead of decoding a live session, reads previously captured raw data from a file to decode. π (replay era, we love her)-Iβ Enter interactive mode at startup. π¬-S<n>β Toggle output on or off whenSIGUSR1is received. If n is0, the initial state is off. If n is1, the initial state is on. π-Tβ Transpose some output with an offset of0x20. π-Aβ Enables tracing of the Network Audio System (NAS) protocol as well, using a port number derived by adding 2000 to the X11 port number. π-a<level>β NAS verbose output level (1 to 4, 1 by default).-n<server-host>β Set the hostname of the NAS server to connect to.-D<level>β Print debugging information at the specified level (255 by default):- 2, Trace each procedure entry
- 4, I/O, connections
- 8, Scope internals
- 16, Message protocol
- 32 to 64, Was malloc, now unused
- 128 to 256, Really low level
-qβ Quiet output mode. Gives only the names of requests, replies, errors, and events, but does not indicate contents. π€«-rβ Print only raw data without decoding it. π§±-v<level>β Determines the level of printing whichxscopewill provide. The level can be0(same as quiet mode),1(default),2,3,4,5. The larger numbers give more and more output. For example, a successful setup returns a string which is the name of the vendor of the X11 server. At level 1, the explicit field giving the length of the string is suppressed since it can be inferred from the string. At level 2 and above the length is explicitly printed. π-Vβ Print version information and exit. π-tβ Terminatexscopewhen all clients close. πͺ
π INTERACTIVE MODE π
When xscope receives an interrupt signal (normally generated by Control-C) or is started with the -I flag, it enters an interactive mode in which it prompts for commands. Available commands in this mode are:
audio,aβ Show current verbosity level for NAS protocol packets.audio n,a nβ Set current verbosity level for NAS protocol packets to n.break,bβ List currently defined breakpoints.break request...,b request...β Create a breakpoint for the specified protocol requests. The breakpoint will be enabled by default. When the breakpoint is enabled,xscopewill stop for interactive commands after processing a request of the specified type. Requests and extensions may be specified by name or number. If an extension is followed by a":"and a number, it will only break for the specified minor opcode for that extension.
β οΈ Note that since extension opcodes are not known until the extension is first seen, breakpoints cannot currently be set on extensions until after aQueryExtensionrequest and reply are processed for that extension, so users may need to initially set a breakpoint onQueryExtension, and after processing that set the breakpoint for the target extension.
cont,cβ Resume processing of data passing between server and clients.delete,delβ Delete all breakpoints.delete breakpoint...,del breakpoint...β Delete listed breakpoints, specified by number.disable,dβ Disable all breakpoints.disable breakpoint...,d breakpoint...β Disable listed breakpoints, specified by number.enable,eβ Enable all breakpoints.enable breakpoint...,e breakpoint...β Enable listed breakpoints, specified by number.help,?β Print list of available commands.help command...,? command...β Describe specified command or commands.level,lβ Show current verbosity level for X11 protocol packets.level n,l nβ Set current verbosity level for X11 protocol packets to n.quit,qβ Quitxscope.step,sβ Process one request, then prompt for another command.
π EXAMPLES π
xscope -v4 -hcleo -d0 -o0 -i1
This command would have xscope communicate with an X11 server on host `cleo`, display 0; xscope itself would be available on the current host as display 1 (display of 0 plus the 1 of -i1). Verbose level 4. π
xscope -q -d1 -o1 -o3
The X11 server for the current host, display 2 (1 for -d1 plus 1 for -o1) would be used by xscope which would run as display 4 (1 for -d1 plus 3 for -o3). Quiet mode (verbose level 0). π€«
π SEE ALSO π
X(7), Xsecurity(7), X11 Protocol and extension protocol documents
π AUTHOR π
James L. Peterson (MCC)
Copyright (C) 1988 MCC
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of MCC not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. MCC makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
π¨ MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL MCC BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
okay that's the whole thing bestie, slay, you're now officially an xscope girlie π
This one's from the X Version 11 crew, specifically xscope 1.4.5 β yeah, she's been iconic for a minute and she's still serving. π«Ά mwah, go decode some protocol, ily β¨
π¦ where this page comes from
- fedora 43: xscope 1.4.5-2.fc43 Β· MIT AND HPND-sell-variant
- fedora 44: xscope 1.4.5-2.fc43 Β· MIT AND HPND-sell-variant
- nixos 26.05: xscope 1.4.5
- nixpkgs unstable: xscope 1.4.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms