Merge branch 'obsd-master'
[tmux.git] / tmux-protocol.h
blob3cf00c0945548d9387ffc4ac4ec0e4c196de4ae2
1 /* $OpenBSD$ */
3 /*
4 * Copyright (c) 2021 Nicholas Marriott <nicholas.marriott@gmail.com>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
15 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
16 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 #ifndef TMUX_PROTOCOL_H
20 #define TMUX_PROTOCOL_H
22 /* Protocol version. */
23 #define PROTOCOL_VERSION 8
25 /* Message types. */
26 enum msgtype {
27 MSG_VERSION = 12,
29 MSG_IDENTIFY_FLAGS = 100,
30 MSG_IDENTIFY_TERM,
31 MSG_IDENTIFY_TTYNAME,
32 MSG_IDENTIFY_OLDCWD, /* unused */
33 MSG_IDENTIFY_STDIN,
34 MSG_IDENTIFY_ENVIRON,
35 MSG_IDENTIFY_DONE,
36 MSG_IDENTIFY_CLIENTPID,
37 MSG_IDENTIFY_CWD,
38 MSG_IDENTIFY_FEATURES,
39 MSG_IDENTIFY_STDOUT,
40 MSG_IDENTIFY_LONGFLAGS,
41 MSG_IDENTIFY_TERMINFO,
43 MSG_COMMAND = 200,
44 MSG_DETACH,
45 MSG_DETACHKILL,
46 MSG_EXIT,
47 MSG_EXITED,
48 MSG_EXITING,
49 MSG_LOCK,
50 MSG_READY,
51 MSG_RESIZE,
52 MSG_SHELL,
53 MSG_SHUTDOWN,
54 MSG_OLDSTDERR, /* unused */
55 MSG_OLDSTDIN, /* unused */
56 MSG_OLDSTDOUT, /* unused */
57 MSG_SUSPEND,
58 MSG_UNLOCK,
59 MSG_WAKEUP,
60 MSG_EXEC,
61 MSG_FLAGS,
63 MSG_READ_OPEN = 300,
64 MSG_READ,
65 MSG_READ_DONE,
66 MSG_WRITE_OPEN,
67 MSG_WRITE,
68 MSG_WRITE_READY,
69 MSG_WRITE_CLOSE,
70 MSG_READ_CANCEL
74 * Message data.
76 * Don't forget to bump PROTOCOL_VERSION if any of these change!
78 struct msg_command {
79 int argc;
80 }; /* followed by packed argv */
82 struct msg_read_open {
83 int stream;
84 int fd;
85 }; /* followed by path */
87 struct msg_read_data {
88 int stream;
91 struct msg_read_done {
92 int stream;
93 int error;
96 struct msg_read_cancel {
97 int stream;
100 struct msg_write_open {
101 int stream;
102 int fd;
103 int flags;
104 }; /* followed by path */
106 struct msg_write_data {
107 int stream;
108 }; /* followed by data */
110 struct msg_write_ready {
111 int stream;
112 int error;
115 struct msg_write_close {
116 int stream;
119 #endif /* TMUX_PROTOCOL_H */