1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Rename TMATE_SLAVE -> TMATE

This commit is contained in:
Nicolas Viennot 2019-11-07 08:29:41 -05:00
parent 4b79571357
commit 975f60d2ac
40 changed files with 103 additions and 103 deletions

View File

@ -227,7 +227,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
struct termios tio, saved_tio;
size_t size;
#ifndef TMATE_SLAVE
#ifndef TMATE
/* Ignore SIGCHLD now or daemon() in the server will leave a zombie. */
signal(SIGCHLD, SIG_IGN);
#endif
@ -264,7 +264,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
cmd_list_free(cmdlist);
}
#ifdef TMATE_SLAVE
#ifdef TMATE
fd = tmate_session->tmux_socket_fd;
/* Create client process structure (starts logging). */
@ -308,7 +308,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
fatal("pledge failed");
#endif
#ifndef TMATE_SLAVE
#ifndef TMATE
/* Free stuff that is not used in the client. */
options_free(global_options);
options_free(global_s_options);
@ -401,7 +401,7 @@ client_send_identify(const char *ttynam, const char *cwd)
int fd, flags = client_flags;
pid_t pid;
#ifdef TMATE_SLAVE
#ifdef TMATE
if (tmate_session->ssh_client.pubkey) {
proc_send(client_peer, MSG_IDENTIFY_TMATE_AUTH_PUBKEY, -1,
tmate_session->ssh_client.pubkey,
@ -648,7 +648,7 @@ client_dispatch_wait(struct imsg *imsg, const char *shellcmd)
if (datalen == 0 || data[datalen - 1] != '\0')
fatalx("bad MSG_SHELL string");
#ifdef TMATE_SLAVE
#ifdef TMATE
exit(1);
#else
clear_signals(0);

View File

@ -47,7 +47,7 @@ const struct cmd_entry cmd_break_pane_entry = {
enum cmd_retval
cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -69,7 +69,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq)
enum cmd_retval
join_pane(struct cmd *self, struct cmd_q *cmdq, int not_same_window)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -44,7 +44,7 @@ const struct cmd_entry cmd_kill_pane_entry = {
enum cmd_retval
cmd_kill_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct winlink *wl = cmdq->state.tflag.wl;

View File

@ -49,7 +49,7 @@ const struct cmd_entry cmd_paste_buffer_entry = {
enum cmd_retval
cmd_paste_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -52,7 +52,7 @@ const struct cmd_entry cmd_pipe_pane_entry = {
enum cmd_retval
cmd_pipe_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -191,7 +191,7 @@ cmdq_continue_one(struct cmd_q *cmdq)
char *tmp;
int flags = !!(cmd->flags & CMD_CONTROL);
#ifdef TMATE_SLAVE
#ifdef TMATE
int client_id;
if (!tmate_should_exec_cmd_locally(cmd->entry)) {
client_id = cmdq->client ? cmdq->client->id : -1;

View File

@ -47,7 +47,7 @@ const struct cmd_entry cmd_resize_pane_entry = {
enum cmd_retval
cmd_resize_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -46,7 +46,7 @@ const struct cmd_entry cmd_respawn_pane_entry = {
enum cmd_retval
cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -45,7 +45,7 @@ const struct cmd_entry cmd_respawn_window_entry = {
enum cmd_retval
cmd_respawn_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -42,7 +42,7 @@ const struct cmd_entry cmd_rotate_window_entry = {
enum cmd_retval
cmd_rotate_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct winlink *wl = cmdq->state.tflag.wl;

View File

@ -70,7 +70,7 @@ const struct cmd_entry cmd_previous_layout_entry = {
enum cmd_retval
cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -58,7 +58,7 @@ const struct cmd_entry cmd_send_prefix_entry = {
enum cmd_retval
cmd_send_keys_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -114,7 +114,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
else
valstr = args->argv[1];
#ifdef TMATE_SLAVE
#ifdef TMATE
if (!args_has(args, 'u'))
tmate_hook_set_option(optstr, valstr);
#endif
@ -191,7 +191,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
}
/* Start or stop timers if necessary. */
#ifndef TMATE_SLAVE
#ifndef TMATE
if (strcmp(oe->name, "automatic-rename") == 0) {
RB_FOREACH(w, windows, &windows) {
if (options_get_number(w->options, "automatic-rename"))

View File

@ -51,7 +51,7 @@ const struct cmd_entry cmd_split_window_entry = {
enum cmd_retval
cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct args *args = self->args;

View File

@ -45,7 +45,7 @@ const struct cmd_entry cmd_swap_pane_entry = {
enum cmd_retval
cmd_swap_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return (CMD_RETURN_ERROR);
#else
struct winlink *src_wl, *dst_wl;

View File

@ -47,7 +47,7 @@ const struct cmd_entry cmd_switch_client_entry = {
enum cmd_retval
cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
cmdq_error(cmdq, "client switch is not supported");
return (CMD_RETURN_ERROR);
#else

View File

@ -80,7 +80,7 @@ control_notify_window_layout_changed(struct window *w)
if (winlink_find_by_window_id(&s->windows, w->id) == NULL)
continue;
#ifndef TMATE_SLAVE
#ifndef TMATE
/*
* When the last pane in a window is closed it won't have a
* layout root and we don't need to inform the client about the

View File

@ -361,7 +361,7 @@ format_cb_window_layout(struct format_tree *ft, struct format_entry *fe)
if (w == NULL)
return;
#ifdef TMATE_SLAVE
#ifdef TMATE
fe->value = xstrdup("no layout");
#else
if (w->saved_layout_root != NULL)
@ -380,14 +380,14 @@ format_cb_window_visible_layout(struct format_tree *ft, struct format_entry *fe)
if (w == NULL)
return;
#ifdef TMATE_SLAVE
#ifdef TMATE
fe->value = xstrdup("no layout");
#else
fe->value = layout_dump(w->layout_root);
#endif
}
#ifndef TMATE_SLAVE
#ifndef TMATE
/* Callback for pane_start_command. */
void
format_cb_start_command(struct format_tree *ft, struct format_entry *fe)
@ -1187,7 +1187,7 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "pane_active", "%d", wp == wp->window->active);
format_add(ft, "pane_input_off", "%d", !!(wp->flags & PANE_INPUTOFF));
#ifndef TMATE_SLAVE
#ifndef TMATE
status = wp->status;
if (wp->fd == -1 && WIFEXITED(status))
format_add(ft, "pane_dead_status", "%d", WEXITSTATUS(status));
@ -1207,7 +1207,7 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "pane_tty", "%s", wp->tty);
format_add(ft, "pane_pid", "%ld", (long) wp->pid);
#ifndef TMATE_SLAVE
#ifndef TMATE
format_add_cb(ft, "pane_start_command", format_cb_start_command);
format_add_cb(ft, "pane_current_command", format_cb_current_command);
format_add_cb(ft, "pane_current_path", format_cb_current_path);

View File

@ -23,7 +23,7 @@
#include "tmux.h"
#ifndef TMATE_SLAVE
#ifndef TMATE
/*
* This file is rather misleadingly named, it contains the code which takes a

View File

@ -839,7 +839,7 @@ input_parse(struct window_pane *wp)
{
struct input_ctx *ictx = wp->ictx;
const struct input_transition *itr;
#ifdef TMATE_SLAVE
#ifdef TMATE
struct evbuffer *evb = wp->event_input;
#else
struct evbuffer *evb = wp->event->input;
@ -961,7 +961,7 @@ input_get(struct input_ctx *ictx, u_int validx, int minval, int defval)
void
input_reply(struct input_ctx *ictx, const char *fmt, ...)
{
#ifndef TMATE_SLAVE
#ifndef TMATE
va_list ap;
char *reply;

2
job.c
View File

@ -49,7 +49,7 @@ job_run(const char *cmd, struct session *s, const char *cwd,
int nullfd, out[2];
const char *home;
#ifdef TMATE_SLAVE
#ifdef TMATE
return NULL;
#endif

View File

@ -23,7 +23,7 @@
#include "tmux.h"
#ifndef TMATE_SLAVE
#ifndef TMATE
struct layout_cell *layout_find_bottomright(struct layout_cell *);
u_short layout_checksum(const char *);

View File

@ -22,7 +22,7 @@
#include "tmux.h"
#ifndef TMATE_SLAVE
#ifndef TMATE
/*
* Set window layouts - predefined methods to arrange windows. These are

View File

@ -22,7 +22,7 @@
#include "tmux.h"
#ifndef TMATE_SLAVE
#ifndef TMATE
/*
* The window layout is a tree of cells each of which can be one of: a

View File

@ -25,7 +25,7 @@
#include "tmux.h"
#ifdef TMATE_SLAVE
#ifdef TMATE
char *
default_window_name(struct window *w)

6
proc.c
View File

@ -172,7 +172,7 @@ proc_start(const char *name, struct event_base *base, int forkflag,
struct tmuxproc *tp;
struct utsname u;
#ifdef TMATE_SLAVE
#ifdef TMATE
if (forkflag)
fatal("can't fork");
#else
@ -210,7 +210,7 @@ proc_start(const char *name, struct event_base *base, int forkflag,
tp = xcalloc(1, sizeof *tp);
tp->name = xstrdup(name);
#ifndef TMATE_SLAVE
#ifndef TMATE
tp->signalcb = signalcb;
set_signals(proc_signal_cb, tp);
#endif
@ -226,7 +226,7 @@ proc_loop(struct tmuxproc *tp, int (*loopcb)(void))
event_loop(EVLOOP_ONCE);
while (!tp->exit && (loopcb == NULL || !loopcb ()));
#ifdef TMATE_SLAVE
#ifdef TMATE
/* flush data on sockets */
event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
#endif

View File

@ -61,7 +61,7 @@ recalculate_sizes(void)
TAILQ_FOREACH(c, &clients, entry) {
if (c->flags & CLIENT_SUSPENDED)
continue;
#ifdef TMATE_SLAVE
#ifdef TMATE
if (c->flags & CLIENT_READONLY)
continue;
#endif
@ -78,7 +78,7 @@ recalculate_sizes(void)
}
}
#ifdef TMATE_SLAVE
#ifdef TMATE
if (tmate_has_websocket()) {
if (tmate_session->websocket_sy < ssy)
ssy = tmate_session->websocket_sy;
@ -155,7 +155,7 @@ recalculate_sizes(void)
is_zoomed = w->flags & WINDOW_ZOOMED;
if (is_zoomed)
window_unzoom(w);
#ifndef TMATE_SLAVE
#ifndef TMATE
layout_resize(w, ssx, ssy);
#endif
window_resize(w, ssx, ssy);

View File

@ -96,7 +96,7 @@ server_client_get_key_table(struct client *c)
return (name);
}
#ifdef TMATE_SLAVE
#ifdef TMATE
u_int next_client_id;
#endif
@ -110,7 +110,7 @@ server_client_create(int fd)
c = xcalloc(1, sizeof *c);
#ifdef TMATE_SLAVE
#ifdef TMATE
c->id = next_client_id++;
c->ip_address = NULL;
c->pubkey = NULL;
@ -204,7 +204,7 @@ server_client_lost(struct client *c)
TAILQ_REMOVE(&clients, c, entry);
log_debug("lost client %p", c);
#ifdef TMATE_SLAVE
#ifdef TMATE
tmate_notify_client_left(tmate_session, c);
#endif
@ -252,7 +252,7 @@ server_client_lost(struct client *c)
cmdq_free(c->cmdq);
c->cmdq = NULL;
#ifdef TMATE_SLAVE
#ifdef TMATE
free(c->ip_address);
c->ip_address = NULL;
free(c->pubkey);
@ -266,7 +266,7 @@ server_client_lost(struct client *c)
server_client_unref(c);
#ifndef TMATE_SLAVE
#ifndef TMATE
server_add_accept(0); /* may be more file descriptors now */
#endif
@ -632,7 +632,7 @@ server_client_handle_key(struct client *c, key_code key)
window_unzoom(w);
wp = window_pane_at_index(w, key - '0');
if (wp != NULL && window_pane_visible(wp))
#ifdef TMATE_SLAVE
#ifdef TMATE
tmate_client_set_active_pane(c->id, key - '0', wp->id);
#else
window_set_active_pane(w, wp);
@ -783,7 +783,7 @@ server_client_loop(void)
RB_FOREACH(w, windows, &windows) {
w->flags &= ~WINDOW_REDRAW;
TAILQ_FOREACH(wp, &w->panes, entry) {
#ifndef TMATE_SLAVE
#ifndef TMATE
if (wp->fd != -1) {
server_client_check_focus(wp);
server_client_check_resize(wp);
@ -795,7 +795,7 @@ server_client_loop(void)
}
}
#ifndef TMATE_SLAVE
#ifndef TMATE
/* Check if pane should be resized. */
void
server_client_check_resize(struct window_pane *wp)
@ -1059,7 +1059,7 @@ server_client_dispatch(struct imsg *imsg, void *arg)
if (c->flags & CLIENT_DEAD)
return;
#ifdef TMATE_SLAVE
#ifdef TMATE
if (c->flags & CLIENT_EXIT)
return;
#endif
@ -1072,7 +1072,7 @@ server_client_dispatch(struct imsg *imsg, void *arg)
data = imsg->data;
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
#ifdef TMATE_SLAVE
#ifdef TMATE
switch (imsg->hdr.type) {
case MSG_IDENTIFY_TMATE_IP_ADDRESS:
case MSG_IDENTIFY_TMATE_AUTH_NONE:
@ -1103,7 +1103,7 @@ server_client_dispatch(struct imsg *imsg, void *arg)
return;
}
#ifdef TMATE_SLAVE
#ifdef TMATE
if (!(c->flags & CLIENT_IDENTIFIED)) {
tmate_warn("dropping unidentified client message: %d", imsg->hdr.type);
return;
@ -1308,7 +1308,7 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
memcpy(&c->pid, data, sizeof c->pid);
log_debug("client %p IDENTIFY_CLIENTPID %ld", c, (long)c->pid);
break;
#ifdef TMATE_SLAVE
#ifdef TMATE
case MSG_IDENTIFY_TMATE_IP_ADDRESS:
if (datalen == 0 || data[datalen - 1] != '\0')
fatalx("bad MSG_IDENTIFY_TMATE_IP_ADDRESS string");
@ -1380,7 +1380,7 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
if (!(c->flags & CLIENT_CONTROL))
c->flags |= CLIENT_TERMINAL;
#ifdef TMATE_SLAVE
#ifdef TMATE
tmate_notify_client_join(tmate_session, c);
#endif
}

View File

@ -294,7 +294,7 @@ void
server_destroy_pane(struct window_pane *wp, int hooks)
{
struct window *w = wp->window;
#ifndef TMATE_SLAVE
#ifndef TMATE
int old_fd;
struct screen_write_ctx ctx;
struct grid_cell gc;
@ -330,7 +330,7 @@ server_destroy_pane(struct window_pane *wp, int hooks)
#endif
server_unzoom_window(w);
#ifndef TMATE_SLAVE
#ifndef TMATE
layout_close_pane(wp);
window_remove_pane(w, wp);

View File

@ -135,7 +135,7 @@ server_create_socket(void)
int
server_start(struct event_base *base, int lockfd, char *lockfile)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
server_proc = proc_start("server", base, 0, server_signal);
#else
int pair[2];
@ -170,7 +170,7 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
gettimeofday(&start_time, NULL);
#ifdef TMATE_SLAVE
#ifdef TMATE
server_fd = tmate_session->tmux_socket_fd;
#else
server_fd = server_create_socket();
@ -188,19 +188,19 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
start_cfg();
#ifndef TMATE_SLAVE
#ifndef TMATE
status_prompt_load_history();
server_add_accept(0);
#endif
proc_loop(server_proc, server_loop);
#ifndef TMATE_SLAVE
#ifndef TMATE
status_prompt_save_history();
#endif
exit(0);
}
#ifdef TMATE_SLAVE
#ifdef TMATE
static int tmate_server_request_exit;
#endif
@ -212,7 +212,7 @@ server_loop(void)
server_client_loop();
#ifdef TMATE_SLAVE
#ifdef TMATE
if (!ssh_is_connected(tmate_session->ssh_client.session) &&
!tmate_server_request_exit) {
/*
@ -257,7 +257,7 @@ server_send_exit(void)
struct client *c, *c1;
struct session *s, *s1;
#ifdef TMATE_SLAVE
#ifdef TMATE
tmate_server_request_exit = 1;
#endif
@ -378,7 +378,7 @@ server_signal(int sig)
case SIGCHLD:
server_child_signal();
break;
#ifndef TMATE_SLAVE
#ifndef TMATE
case SIGUSR1:
event_del(&server_ev_accept);
fd = server_create_socket();

View File

@ -344,7 +344,7 @@ session_new(struct session *s, const char *name, int argc, char **argv,
shell = _PATH_BSHELL;
hlimit = options_get_number(s->options, "history-limit");
#ifdef TMATE_SLAVE
#ifdef TMATE
hlimit = hlimit > TMATE_HLIMIT ? TMATE_HLIMIT : hlimit;
#endif
w = window_create(name, argc, argv, path, shell, cwd, env, s->tio,

View File

@ -24,7 +24,7 @@
#include "tmux.h"
#ifndef TMATE_SLAVE
#ifndef TMATE
struct event ev_sighup;
struct event ev_sigchld;

View File

@ -217,7 +217,7 @@ status_redraw_get_left(struct client *c, time_t t, struct grid_cell *gc,
char *left;
size_t leftlen;
#ifdef TMATE_SLAVE
#ifdef TMATE
left = xstrdup(tmate_left_status ?: "");
#else
style_apply_update(gc, s->options, "status-left-style");
@ -243,7 +243,7 @@ status_redraw_get_right(struct client *c, time_t t, struct grid_cell *gc,
char *right;
size_t rightlen;
#ifdef TMATE_SLAVE
#ifdef TMATE
right = xstrdup(tmate_right_status ?: "");
#else
style_apply_update(gc, s->options, "status-right-style");
@ -530,7 +530,7 @@ status_print(struct client *c, struct winlink *wl, time_t t,
const char *fmt;
char *text;
#ifdef TMATE_SLAVE
#ifdef TMATE
/* TODO use the host winlink status */
#endif

6
tmux.c
View File

@ -44,7 +44,7 @@ struct hooks *global_hooks;
struct timeval start_time;
const char *socket_path;
#ifndef TMATE_SLAVE
#ifndef TMATE
__dead void usage(void);
static char *make_label(const char *);
@ -167,7 +167,7 @@ setblocking(int fd, int state)
}
}
#ifdef TMATE_SLAVE
#ifdef TMATE
const char * find_home(void) { return NULL; }
int areshell(__unused const char *shell) { return 0; }
#else
@ -350,7 +350,7 @@ main(int argc, char **argv)
}
#endif
#ifdef TMATE_SLAVE
#ifdef TMATE
void tmux_server_init(void)
{
global_hooks = hooks_create(NULL);

24
tmux.h
View File

@ -19,7 +19,7 @@
#ifndef TMUX_H
#define TMUX_H
#define TMATE_SLAVE
#define TMATE
#define PROTOCOL_VERSION 8
@ -432,7 +432,7 @@ enum msgtype {
MSG_UNLOCK,
MSG_WAKEUP,
#ifdef TMATE_SLAVE
#ifdef TMATE
MSG_LATENCY = 300,
MSG_IDENTIFY_TMATE_IP_ADDRESS,
MSG_IDENTIFY_TMATE_AUTH_NONE,
@ -871,7 +871,7 @@ struct window_pane {
struct window *window;
#ifndef TMATE_SLAVE
#ifndef TMATE
struct layout_cell *layout_cell;
struct layout_cell *saved_layout_cell;
#endif
@ -890,7 +890,7 @@ struct window_pane {
#define PANE_FOCUSPUSH 0x10
#define PANE_INPUTOFF 0x20
#define PANE_CHANGED 0x40
#ifdef TMATE_SLAVE
#ifdef TMATE
#define PANE_KILL 0x80
#endif
@ -903,7 +903,7 @@ struct window_pane {
char tty[TTY_NAME_MAX];
int status;
#ifdef TMATE_SLAVE
#ifdef TMATE
struct evbuffer *event_input;
#else
int fd;
@ -955,7 +955,7 @@ struct window {
int lastlayout;
#ifndef TMATE_SLAVE
#ifndef TMATE
struct layout_cell *layout_root;
struct layout_cell *saved_layout_root;
char *old_layout;
@ -973,7 +973,7 @@ struct window {
#define WINDOW_FORCEWIDTH 0x2000
#define WINDOW_FORCEHEIGHT 0x4000
#define WINDOW_ALERTFLAGS (WINDOW_BELL|WINDOW_ACTIVITY|WINDOW_SILENCE)
#ifdef TMATE_SLAVE
#ifdef TMATE
#define WINDOW_KILL 0x8000
#endif
@ -999,7 +999,7 @@ struct winlink {
#define WINLINK_ACTIVITY 0x2
#define WINLINK_SILENCE 0x4
#define WINLINK_ALERTFLAGS (WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_SILENCE)
#ifdef TMATE_SLAVE
#ifdef TMATE
#define WINLINK_KILL 0x80
#endif
@ -1249,7 +1249,7 @@ struct message_entry {
/* Client connection. */
struct client {
#ifdef TMATE_SLAVE
#ifdef TMATE
int id;
#endif
struct tmuxpeer *peer;
@ -1303,7 +1303,7 @@ struct client {
#define CLIENT_256COLOURS 0x20000
#define CLIENT_IDENTIFIED 0x40000
#define CLIENT_STATUSFORCE 0x80000
#ifdef TMATE_SLAVE
#ifdef TMATE
#define CLIENT_TMATE_NOTIFIED_JOIN 0x10000000
#define CLIENT_TMATE_AUTHENTICATED 0x20000000
#endif
@ -1338,7 +1338,7 @@ struct client {
struct cmd_q *cmdq;
int references;
#ifdef TMATE_SLAVE
#ifdef TMATE
char *ip_address;
char *pubkey;
int readonly;
@ -2011,7 +2011,7 @@ void input_reset(struct window_pane *, int);
struct evbuffer *input_pending(struct window_pane *);
void input_parse(struct window_pane *);
#ifndef TMATE_SLAVE
#ifndef TMATE
/* input-key.c */
void input_key(struct window_pane *, key_code, struct mouse_event *);
#endif

View File

@ -407,7 +407,7 @@ tty_term_find(char *name, int fd, char **cause)
LIST_INSERT_HEAD(&tty_terms, term, entry);
/* we are in a jail, no access to files */
#ifndef TMATE_SLAVE
#ifndef TMATE
/* Set up curses terminal. */
if (setupterm(name, fd, &error) != OK) {
switch (error) {
@ -537,7 +537,7 @@ error:
void
tty_term_free(struct tty_term *term)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
/*
* We need to keep the term in memory, because we are in a jail, with
* no file system, so we can't reload them.

2
tty.c
View File

@ -166,7 +166,7 @@ tty_init(struct tty *tty, struct client *c, int fd, char *term)
tty->fd = fd;
tty->client = c;
#ifdef TMATE_SLAVE
#ifdef TMATE
tty->path = NULL;
#else
if ((path = ttyname(fd)) == NULL)

View File

@ -61,7 +61,7 @@ window_copy_init(struct window_pane *wp)
data->searchtype = WINDOW_COPY_OFF;
data->searchstr = NULL;
#ifndef TMATE_SLAVE
#ifndef TMATE
if (wp->fd != -1)
bufferevent_disable(wp->event, EV_READ|EV_WRITE);
#endif
@ -125,7 +125,7 @@ window_copy_free(struct window_pane *wp)
{
struct window_copy_mode_data *data = wp->modedata;
#ifndef TMATE_SLAVE
#ifndef TMATE
if (wp->fd != -1)
bufferevent_enable(wp->event, EV_READ|EV_WRITE);
#endif
@ -1407,7 +1407,7 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess,
struct format_tree *ft;
char *expanded;
#ifdef TMATE_SLAVE
#ifdef TMATE
/* that job_run() is not going to end well */
return;
#endif

View File

@ -297,7 +297,7 @@ window_create1(u_int sx, u_int sy)
TAILQ_INIT(&w->panes);
w->active = NULL;
#ifndef TMATE_SLAVE
#ifndef TMATE
w->lastlayout = -1;
w->layout_root = NULL;
#endif
@ -327,7 +327,7 @@ window_create(const char *name, int argc, char **argv, const char *path,
w = window_create1(sx, sy);
wp = window_add_pane(w, hlimit);
#ifndef TMATE_SLAVE
#ifndef TMATE
layout_init(w, wp);
#endif
@ -352,7 +352,7 @@ window_destroy(struct window *w)
{
RB_REMOVE(windows, &windows, w);
#ifndef TMATE_SLAVE
#ifndef TMATE
if (w->layout_root != NULL)
layout_free_cell(w->layout_root);
if (w->saved_layout_root != NULL)
@ -523,7 +523,7 @@ window_zoom(struct window_pane *wp)
if (w->active != wp)
window_set_active_pane(w, wp);
#ifndef TMATE_SLAVE
#ifndef TMATE
TAILQ_FOREACH(wp1, &w->panes, entry) {
wp1->saved_layout_cell = wp1->layout_cell;
wp1->layout_cell = NULL;
@ -548,7 +548,7 @@ window_unzoom(struct window *w)
w->flags &= ~WINDOW_ZOOMED;
#ifndef TMATE_SLAVE
#ifndef TMATE
layout_free(w);
w->layout_root = w->saved_layout_root;
w->saved_layout_root = NULL;
@ -752,7 +752,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->shell = NULL;
wp->cwd = NULL;
#ifdef TMATE_SLAVE
#ifdef TMATE
wp->event_input = evbuffer_new();
#else
wp->fd = -1;
@ -761,7 +761,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->mode = NULL;
#ifndef TMATE_SLAVE
#ifndef TMATE
wp->layout_cell = NULL;
#endif
@ -798,7 +798,7 @@ window_pane_destroy(struct window_pane *wp)
if (event_initialized(&wp->timer))
evtimer_del(&wp->timer);
#ifdef TMATE_SLAVE
#ifdef TMATE
evbuffer_free(wp->event_input);
#else
if (wp->fd != -1) {
@ -834,7 +834,7 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
const char *path, const char *shell, const char *cwd, struct environ *env,
struct termios *tio, char **cause)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
return 0;
#else
struct winsize ws;
@ -967,7 +967,7 @@ void
window_pane_read_callback(__unused struct bufferevent *bufev, void *data)
{
struct window_pane *wp = data;
#ifdef TMATE_SLAVE
#ifdef TMATE
struct evbuffer *evb = wp->event_input;
#else
struct evbuffer *evb = wp->event->input;
@ -1154,7 +1154,7 @@ void
window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
key_code key, struct mouse_event *m)
{
#ifdef TMATE_SLAVE
#ifdef TMATE
/*
* pane_id == -1, which means that we should send the keys to
* the active pane. This is better due to latency issues in
@ -1199,7 +1199,7 @@ window_pane_visible(struct window_pane *wp)
{
struct window *w = wp->window;
#ifndef TMATE_SLAVE
#ifndef TMATE
if (wp->layout_cell == NULL)
return (0);
#endif