mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 16:43:11 +01:00
Same exit process applied to detach.
This commit is contained in:
parent
5cd1d459c5
commit
7034ba236f
30
client-msg.c
30
client-msg.c
@ -1,4 +1,4 @@
|
||||
/* $Id: client-msg.c,v 1.12 2007-11-27 20:01:30 nicm Exp $ */
|
||||
/* $Id: client-msg.c,v 1.13 2007-11-27 20:03:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -83,6 +83,19 @@ client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int
|
||||
client_msg_fn_detach(
|
||||
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
|
||||
{
|
||||
if (hdr->size != 0)
|
||||
fatalx("bad MSG_DETACH size");
|
||||
|
||||
client_write_server(cctx, MSG_EXITING, NULL, 0);
|
||||
cctx->flags |= CCTX_DETACH;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
client_msg_fn_exit(
|
||||
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
|
||||
@ -91,6 +104,7 @@ client_msg_fn_exit(
|
||||
fatalx("bad MSG_EXIT size");
|
||||
|
||||
client_write_server(cctx, MSG_EXITING, NULL, 0);
|
||||
cctx->flags |= CCTX_EXIT;
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -102,19 +116,5 @@ client_msg_fn_exited(
|
||||
if (hdr->size != 0)
|
||||
fatalx("bad MSG_EXITED size");
|
||||
|
||||
cctx->flags |= CCTX_EXIT;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int
|
||||
client_msg_fn_detach(
|
||||
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
|
||||
{
|
||||
if (hdr->size != 0)
|
||||
fatalx("bad MSG_DETACH size");
|
||||
|
||||
cctx->flags |= CCTX_DETACH;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
4
tmux.h
4
tmux.h
@ -1,4 +1,4 @@
|
||||
/* $Id: tmux.h,v 1.103 2007-11-27 20:01:30 nicm Exp $ */
|
||||
/* $Id: tmux.h,v 1.104 2007-11-27 20:03:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -291,9 +291,9 @@ enum hdrtype {
|
||||
MSG_EXIT,
|
||||
MSG_EXITING,
|
||||
MSG_EXITED,
|
||||
MSG_DETACH,
|
||||
MSG_IDENTIFY,
|
||||
MSG_READY,
|
||||
MSG_DETACH,
|
||||
MSG_RESIZE,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user