mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
tmux new-session -d.
This commit is contained in:
parent
1e316cfc7c
commit
fa537abf83
3
CHANGES
3
CHANGES
@ -1,5 +1,6 @@
|
|||||||
29 September 2007
|
29 September 2007
|
||||||
|
|
||||||
|
* (nicm) Allow creation of detached sessions: "tmux new-session -d".
|
||||||
* (nicm) Permit error messages to be passed back for transient clients like
|
* (nicm) Permit error messages to be passed back for transient clients like
|
||||||
rename. Also make rename -i work.
|
rename. Also make rename -i work.
|
||||||
* (nicm) Pass through bell in any window to current.
|
* (nicm) Pass through bell in any window to current.
|
||||||
@ -74,5 +75,5 @@
|
|||||||
(including mutt, emacs). No status bar yet and no key remapping or other
|
(including mutt, emacs). No status bar yet and no key remapping or other
|
||||||
customisation.
|
customisation.
|
||||||
|
|
||||||
$Id: CHANGES,v 1.15 2007-09-29 13:22:15 nicm Exp $
|
$Id: CHANGES,v 1.16 2007-09-29 14:57:07 nicm Exp $
|
||||||
|
|
||||||
|
14
client-msg.c
14
client-msg.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: client-msg.c,v 1.3 2007-09-26 18:50:49 nicm Exp $ */
|
/* $Id: client-msg.c,v 1.4 2007-09-29 14:57:07 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
int client_msg_fn_output(struct hdr *, struct client_ctx *, char **);
|
int client_msg_fn_output(struct hdr *, struct client_ctx *, char **);
|
||||||
int client_msg_fn_pause(struct hdr *, struct client_ctx *, char **);
|
int client_msg_fn_pause(struct hdr *, struct client_ctx *, char **);
|
||||||
|
int client_msg_fn_done(struct hdr *, struct client_ctx *, char **);
|
||||||
int client_msg_fn_exit(struct hdr *, struct client_ctx *, char **);
|
int client_msg_fn_exit(struct hdr *, struct client_ctx *, char **);
|
||||||
int client_msg_fn_error(struct hdr *, struct client_ctx *, char **);
|
int client_msg_fn_error(struct hdr *, struct client_ctx *, char **);
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ struct client_msg {
|
|||||||
struct client_msg client_msg_table[] = {
|
struct client_msg client_msg_table[] = {
|
||||||
{ MSG_OUTPUT, client_msg_fn_output },
|
{ MSG_OUTPUT, client_msg_fn_output },
|
||||||
{ MSG_PAUSE, client_msg_fn_pause },
|
{ MSG_PAUSE, client_msg_fn_pause },
|
||||||
|
{ MSG_DONE, client_msg_fn_done },
|
||||||
{ MSG_EXIT, client_msg_fn_exit },
|
{ MSG_EXIT, client_msg_fn_exit },
|
||||||
{ MSG_ERROR, client_msg_fn_error },
|
{ MSG_ERROR, client_msg_fn_error },
|
||||||
};
|
};
|
||||||
@ -100,6 +102,16 @@ client_msg_fn_exit(
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Done message from server. */
|
||||||
|
int
|
||||||
|
client_msg_fn_done(
|
||||||
|
struct hdr *hdr, unused struct client_ctx *cctx, unused char **error)
|
||||||
|
{
|
||||||
|
if (hdr->size != 0)
|
||||||
|
fatalx("bad MSG_DONE size");
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Error message from server. */
|
/* Error message from server. */
|
||||||
int
|
int
|
||||||
client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error)
|
client_msg_fn_error(struct hdr *hdr, struct client_ctx *cctx, char **error)
|
||||||
|
14
op.c
14
op.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: op.c,v 1.8 2007-09-29 13:22:15 nicm Exp $ */
|
/* $Id: op.c,v 1.9 2007-09-29 14:57:07 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -30,11 +30,12 @@ op_new(char *path, int argc, char **argv)
|
|||||||
struct new_data data;
|
struct new_data data;
|
||||||
struct client_ctx cctx;
|
struct client_ctx cctx;
|
||||||
char name[MAXNAMELEN];
|
char name[MAXNAMELEN];
|
||||||
int opt;
|
int opt, detached;
|
||||||
|
|
||||||
*name = '\0';
|
*name = '\0';
|
||||||
|
detached = 0;
|
||||||
optind = 1;
|
optind = 1;
|
||||||
while ((opt = getopt(argc, argv, "s:?")) != EOF) {
|
while ((opt = getopt(argc, argv, "s:d?")) != EOF) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 's':
|
case 's':
|
||||||
if (strlcpy(name, optarg, sizeof name) >= sizeof name) {
|
if (strlcpy(name, optarg, sizeof name) >= sizeof name) {
|
||||||
@ -42,9 +43,12 @@ op_new(char *path, int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'd':
|
||||||
|
detached = 1;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
return (usage("new [-s session]"));
|
return (usage("new [-d] [-s session]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
@ -60,6 +64,8 @@ op_new(char *path, int argc, char **argv)
|
|||||||
data.sy = cctx.ws.ws_row;
|
data.sy = cctx.ws.ws_row;
|
||||||
client_write_server(&cctx, MSG_NEW, &data, sizeof data);
|
client_write_server(&cctx, MSG_NEW, &data, sizeof data);
|
||||||
|
|
||||||
|
if (detached)
|
||||||
|
return (client_flush(&cctx));
|
||||||
return (client_main(&cctx));
|
return (client_main(&cctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server-msg.c,v 1.9 2007-09-29 13:22:15 nicm Exp $ */
|
/* $Id: server-msg.c,v 1.10 2007-09-29 14:57:07 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -128,7 +128,8 @@ server_msg_fn_new(struct hdr *hdr, struct client *c)
|
|||||||
if (c->session == NULL)
|
if (c->session == NULL)
|
||||||
fatalx("session_create failed");
|
fatalx("session_create failed");
|
||||||
xfree(cmd);
|
xfree(cmd);
|
||||||
|
|
||||||
|
server_write_client(c, MSG_DONE, NULL, 0);
|
||||||
server_draw_client(c, 0, c->sy - 1);
|
server_draw_client(c, 0, c->sy - 1);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user