From 8d59b189cc9e83ac0049fc3108de1b822fa7b4ce Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 22 Mar 2013 10:31:22 +0000 Subject: No more lint means no more ARGSUSED. --- client.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 90993057..92c3fca3 100644 --- a/client.c +++ b/client.c @@ -360,7 +360,6 @@ client_update_event(void) } /* Callback to handle signals in the client. */ -/* ARGSUSED */ void client_signal(int sig, unused short events, unused void *data) { @@ -407,7 +406,6 @@ client_signal(int sig, unused short events, unused void *data) } /* Callback for client imsg read events. */ -/* ARGSUSED */ void client_callback(unused int fd, short events, void *data) { @@ -442,7 +440,6 @@ lost_server: } /* Callback for client stdin read events. */ -/* ARGSUSED */ void client_stdin_callback(unused int fd, unused short events, unused void *data1) { @@ -571,7 +568,6 @@ client_dispatch_wait(void *data) } /* Dispatch imsgs in attached state (after MSG_READY). */ -/* ARGSUSED */ int client_dispatch_attached(void) { -- cgit From 20636d956dd36c1f14152569a4d44a50eea9083d Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 24 Mar 2013 09:54:10 +0000 Subject: Add a command queue to standardize and simplify commands that call other commands and allow a command to block execution of subsequent commands. This allows run-shell and if-shell to be synchronous which has been much requested. Each client has a default command queue and commands are consumed one at a time from it. A command may suspend execution from the queue by returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example run-shell does this from the callback that is fired after the job is freed. When the command queue becomes empty, command clients are automatically exited (unless attaching). A callback is also fired - this is used for nested commands in, for example, if-shell which can block execution of the client's cmdq until a new cmdq becomes empty. Also merge all the old error/info/print functions together and lose the old curclient/cmdclient distinction - a cmdq is bound to one client (or none if in the configuration file), this is a command client if c->session is NULL otherwise an attached client. --- client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index 92c3fca3..8693afeb 100644 --- a/client.c +++ b/client.c @@ -188,7 +188,8 @@ client_main(int argc, char **argv, int flags) * later in server) but it is necessary to get the start server * flag. */ - if ((cmdlist = cmd_list_parse(argc, argv, &cause)) == NULL) { + cmdlist = cmd_list_parse(argc, argv, NULL, 0, &cause); + if (cmdlist == NULL) { fprintf(stderr, "%s\n", cause); return (1); } -- cgit From 62db3c8efe70020e2555e3f34e8c07d0b2106077 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 25 Mar 2013 10:03:24 +0000 Subject: Send DSC 1000p at the beginning of a -CC client's lifetime and ST and the end, from George Nachman. --- client.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index 8693afeb..1ab42c51 100644 --- a/client.c +++ b/client.c @@ -292,8 +292,16 @@ client_main(int argc, char **argv, int flags) ppid = getppid(); if (client_exittype == MSG_DETACHKILL && ppid > 1) kill(ppid, SIGHUP); - } else if (flags & IDENTIFY_TERMIOS) + } else if (flags & IDENTIFY_TERMIOS) { + if (flags & IDENTIFY_CONTROL) { + if (client_exitreason != CLIENT_EXIT_NONE) + printf("%%exit %s\n", client_exit_message()); + else + printf("%%exit\n"); + printf("\033\\"); + } tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio); + } setblocking(STDIN_FILENO, 1); return (client_exitval); } -- cgit From 6fee3e9e4b4c68c5d3d7f333c779ac865af7bf86 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 25 Mar 2013 10:11:45 +0000 Subject: Rename session idx to session id throughout and add $ prefix to targets to use it, extended from a diff from George Nachman. --- client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index 1ab42c51..f3e5dbdc 100644 --- a/client.c +++ b/client.c @@ -266,7 +266,7 @@ client_main(int argc, char **argv, int flags) if (msg == MSG_COMMAND) { /* Fill in command line arguments. */ cmddata.pid = environ_pid; - cmddata.idx = environ_idx; + cmddata.session_id = environ_session_id; /* Prepare command for server. */ cmddata.argc = argc; -- cgit From 88b92df8492092fbbab37a3ddd2390e0eee2cb24 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 25 Mar 2013 11:38:57 +0000 Subject: We ignore SIGWINCH until ready, so send a MSG_RESIZE immediately when becoming ready. --- client.c | 1 + 1 file changed, 1 insertion(+) (limited to 'client.c') diff --git a/client.c b/client.c index f3e5dbdc..70e7f1ec 100644 --- a/client.c +++ b/client.c @@ -520,6 +520,7 @@ client_dispatch_wait(void *data) event_del(&client_stdin); client_attached = 1; + client_write_server(MSG_RESIZE, NULL, 0); break; case MSG_STDIN: if (datalen != 0) -- cgit