diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-12-06 09:46:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-12-06 09:46:23 +0000 |
commit | 103748d6adfe1b2d706cb0a1e1a128be5366d655 (patch) | |
tree | b9d4feef5012083d9c0ba96693322286645a27a3 | |
parent | 6f142e9ac61783e79c27e56ed6aa2fc7ff13683d (diff) |
Major reorganisation of screen handling.
52 files changed, 2085 insertions, 1539 deletions
@@ -1,3 +1,11 @@ +06 December 2007 + +* Another major reorganisation, this time of screen handling. A new set of + functions, screen_write_*, are now used to write to a screen and a tty + simultaneously. These are used by the input parser to update the base + window screen and also by the different modes which now interpose their own + screen. + 30 November 2007 * Support \ek...\e\ to set window name. @@ -289,4 +297,4 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.89 2007-11-30 11:08:34 nicm Exp $ +$Id: CHANGES,v 1.90 2007-12-06 09:46:21 nicm Exp $ diff --git a/GNUmakefile b/GNUmakefile index 3acfd1c7..7c3354f1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# $Id: GNUmakefile,v 1.8 2007-11-25 22:08:13 nicm Exp $ +# $Id: GNUmakefile,v 1.9 2007-12-06 09:46:21 nicm Exp $ .PHONY: clean @@ -37,7 +37,7 @@ CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wwrite-strings -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare CFLAGS+= -Wundef -Wbad-function-cast -Winline -Wcast-align -LDFLAGS+= +LDFLAGS+= LIBS+= -lncurses PREFIX?= /usr/local @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.51 2007-11-30 13:59:16 nicm Exp $ +# $Id: Makefile,v 1.52 2007-12-06 09:46:21 nicm Exp $ .SUFFIXES: .c .o .y .h .PHONY: clean update-index.html upload-index.html @@ -28,7 +28,7 @@ SRCS= tmux.c server.c server-msg.c server-fn.c buffer.c buffer-poll.c status.c \ cmd-swap-window.c cmd-rename-session.c cmd-kill-session.c \ cmd-switch-client.c cmd-has-session.c cmd-scroll-mode.c cmd-copy-mode.c \ cmd-paste-buffer.c window-scroll.c window-more.c window-copy.c \ - tty.c tty-keys.c tty-write.c + tty.c tty-keys.c tty-write.c screen-write.c screen-redraw.c CC?= cc INCDIRS+= -I. -I- -I/usr/local/include @@ -66,7 +66,7 @@ -- For 0.2 -------------------------------------------------------------------- - window splitting? -- restore term cap checks +- restore term cap checks **** - anything which uses cmd_{send,recv}_string will break if the string is split. string length should be part of the command size - echo \\033[35\;46m\\033[2J last line quirk (with C-b r) @@ -74,6 +74,20 @@ - is ACS the right way round?? -------- + +screen redraw. + +ops: +- redraw screen or section of screen to tty without altering it + (screen-redraw.c, screen_redraw_ctx) + (switching screen etc) +- draw to screen and optionally tty + (window output) + (screen-write.c, screen_write_ctx) +- copy line/column from one screen (inc history) at offset?? + (scroll/copy mode) + +-------- kmous -- \E[M mouse init: putp("\033[?1000h"); @@ -1,4 +1,4 @@ -/* $Id: buffer.c,v 1.3 2007-11-27 19:23:33 nicm Exp $ */ +/* $Id: buffer.c,v 1.4 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -215,7 +215,7 @@ uint16_t buffer_read16(struct buffer *b) { uint16_t n; - + n = BUFFER_OUT(b)[0] | (BUFFER_OUT(b)[1] << 8); buffer_remove(b, 2); return (n); diff --git a/client-msg.c b/client-msg.c index 878bbcd0..65287f50 100644 --- a/client-msg.c +++ b/client-msg.c @@ -1,4 +1,4 @@ -/* $Id: client-msg.c,v 1.13 2007-11-27 20:03:08 nicm Exp $ */ +/* $Id: client-msg.c,v 1.14 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -34,7 +34,7 @@ int client_msg_fn_pause(struct hdr *, struct client_ctx *, char **); struct client_msg { enum hdrtype type; - + int (*fn)(struct hdr *, struct client_ctx *, char **); }; struct client_msg client_msg_table[] = { @@ -58,7 +58,7 @@ client_msg_dispatch(struct client_ctx *cctx, char **error) if (BUFFER_USED(cctx->srv_in) < (sizeof hdr) + hdr.size) return (1); buffer_remove(cctx->srv_in, sizeof hdr); - + for (i = 0; i < NCLIENTMSG; i++) { msg = client_msg_table + i; if (msg->type == hdr.type) { @@ -92,7 +92,7 @@ client_msg_fn_detach( client_write_server(cctx, MSG_EXITING, NULL, 0); cctx->flags |= CCTX_DETACH; - + return (0); } @@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.24 2007-12-01 11:10:33 nicm Exp $ */ +/* $Id: client.c,v 1.25 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -134,7 +134,7 @@ client_main(struct client_ctx *cctx) pfd.events = POLLIN; if (BUFFER_USED(cctx->srv_out) > 0) pfd.events |= POLLOUT; - + if (poll(&pfd, 1, timeout) == -1) { if (errno == EAGAIN || errno == EINTR) continue; @@ -157,18 +157,18 @@ client_main(struct client_ctx *cctx) break; } } - + out: if (sigterm) { printf("[terminated]\n"); return (1); } - + if (cctx->flags & CCTX_EXIT) { printf("[exited]\n"); return (0); } - + if (cctx->flags & CCTX_DETACH) { printf("[detached]\n"); return (0); @@ -187,13 +187,13 @@ client_handle_winch(struct client_ctx *cctx) { struct msg_resize_data data; struct winsize ws; - + if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1) fatal("ioctl failed"); data.sx = ws.ws_col; data.sy = ws.ws_row; client_write_server(cctx, MSG_RESIZE, &data, sizeof data); - + sigwinch = 0; } diff --git a/cmd-attach-session.c b/cmd-attach-session.c index 930b756b..1741b36e 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-attach-session.c,v 1.10 2007-11-27 19:23:33 nicm Exp $ */ +/* $Id: cmd-attach-session.c,v 1.11 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -40,7 +40,7 @@ const struct cmd_entry cmd_attach_session_entry = { "attach-session", "attach", "[-d]", CMD_CANTNEST|CMD_NOCLIENT, cmd_attach_session_parse, - cmd_attach_session_exec, + cmd_attach_session_exec, cmd_attach_session_send, cmd_attach_session_recv, cmd_attach_session_free @@ -63,7 +63,7 @@ cmd_attach_session_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 0) diff --git a/cmd-bind-key.c b/cmd-bind-key.c index 5f739aca..537a12f5 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -1,4 +1,4 @@ -/* $Id: cmd-bind-key.c,v 1.7 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-bind-key.c,v 1.8 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -41,7 +41,7 @@ const struct cmd_entry cmd_bind_key_entry = { "bind-key", "bind", "key command [arguments]", CMD_NOCLIENT|CMD_NOSESSION, cmd_bind_key_parse, - cmd_bind_key_exec, + cmd_bind_key_exec, cmd_bind_key_send, cmd_bind_key_recv, cmd_bind_key_free @@ -61,7 +61,7 @@ cmd_bind_key_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc < 1) diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c index 665507e1..c5945743 100644 --- a/cmd-copy-mode.c +++ b/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $Id: cmd-copy-mode.c,v 1.2 2007-11-27 19:23:33 nicm Exp $ */ +/* $Id: cmd-copy-mode.c,v 1.3 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -33,7 +33,7 @@ const struct cmd_entry cmd_copy_mode_entry = { "copy-mode", NULL, "", CMD_NOCLIENT, NULL, - cmd_copy_mode_exec, + cmd_copy_mode_exec, NULL, NULL, NULL diff --git a/cmd-kill-session.c b/cmd-kill-session.c index e4addc87..21cb6025 100644 --- a/cmd-kill-session.c +++ b/cmd-kill-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-kill-session.c,v 1.4 2007-11-21 13:11:41 nicm Exp $ */ +/* $Id: cmd-kill-session.c,v 1.5 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -47,7 +47,7 @@ cmd_kill_session_exec(unused void *ptr, struct cmd_ctx *ctx) { struct client *c; u_int i; - + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); if (c->session == ctx->session) { @@ -57,7 +57,7 @@ cmd_kill_session_exec(unused void *ptr, struct cmd_ctx *ctx) } session_destroy(ctx->session); - + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-kill-window.c b/cmd-kill-window.c index e962fc75..13742e19 100644 --- a/cmd-kill-window.c +++ b/cmd-kill-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-kill-window.c,v 1.6 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-kill-window.c,v 1.7 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -41,7 +41,7 @@ const struct cmd_entry cmd_kill_window_entry = { "kill-window", "killw", "[-i index]", CMD_NOCLIENT, cmd_kill_window_parse, - cmd_kill_window_exec, + cmd_kill_window_exec, cmd_kill_window_send, cmd_kill_window_recv, cmd_kill_window_free @@ -69,7 +69,7 @@ cmd_kill_window_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 0) @@ -117,7 +117,7 @@ cmd_kill_window_exec(void *ptr, struct cmd_ctx *ctx) } else server_redraw_client(c); } - + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-last-window.c b/cmd-last-window.c index 7052c1f1..e68289cd 100644 --- a/cmd-last-window.c +++ b/cmd-last-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-last-window.c,v 1.5 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-last-window.c,v 1.6 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -45,8 +45,8 @@ cmd_last_window_exec(unused void *ptr, struct cmd_ctx *ctx) if (session_last(ctx->session) == 0) server_redraw_session(ctx->session); else - ctx->error(ctx, "no last window"); - + ctx->error(ctx, "no last window"); + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-link-window.c b/cmd-link-window.c index 331c6c45..00e3b4a7 100644 --- a/cmd-link-window.c +++ b/cmd-link-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-link-window.c,v 1.8 2007-11-21 15:05:53 nicm Exp $ */ +/* $Id: cmd-link-window.c,v 1.9 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -45,7 +45,7 @@ const struct cmd_entry cmd_link_window_entry = { "link-window", "linkw", "[-dk] [-i index] name index", CMD_NOCLIENT, cmd_link_window_parse, - cmd_link_window_exec, + cmd_link_window_exec, cmd_link_window_send, cmd_link_window_recv, cmd_link_window_free @@ -83,7 +83,7 @@ cmd_link_window_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 2) @@ -116,7 +116,7 @@ cmd_link_window_exec(void *ptr, struct cmd_ctx *ctx) if (data == NULL) return; - + if ((src = session_find(data->srcname)) == NULL) { ctx->error(ctx, "session not found: %s", data->srcname); return; @@ -155,7 +155,7 @@ cmd_link_window_exec(void *ptr, struct cmd_ctx *ctx) dst->lastw = NULL; /* - * Can't error out after this or there could be an empty + * Can't error out after this or there could be an empty * session! */ } diff --git a/cmd-list-windows.c b/cmd-list-windows.c index 111101b2..056af295 100644 --- a/cmd-list-windows.c +++ b/cmd-list-windows.c @@ -1,4 +1,4 @@ -/* $Id: cmd-list-windows.c,v 1.14 2007-11-23 13:11:43 nicm Exp $ */ +/* $Id: cmd-list-windows.c,v 1.15 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -51,18 +51,18 @@ cmd_list_windows_exec(unused void *ptr, struct cmd_ctx *ctx) w = wl->window; size = 0; - for (i = 0; i < w->screen.hsize; i++) - size += w->screen.grid_size[i] * 3; - size += w->screen.hsize * (sizeof *w->screen.grid_data); - size += w->screen.hsize * (sizeof *w->screen.grid_attr); - size += w->screen.hsize * (sizeof *w->screen.grid_colr); - size += w->screen.hsize * (sizeof *w->screen.grid_size); + for (i = 0; i < w->base.hsize; i++) + size += w->base.grid_size[i] * 3; + size += w->base.hsize * (sizeof *w->base.grid_data); + size += w->base.hsize * (sizeof *w->base.grid_attr); + size += w->base.hsize * (sizeof *w->base.grid_colr); + size += w->base.hsize * (sizeof *w->base.grid_size); ctx->print(ctx, "%d: %s \"%s\" (%s) [%ux%u] [history %u/%u, %llu bytes]", - wl->idx, w->name, w->screen.title, ttyname(w->fd), - screen_size_x(&w->screen), screen_size_y(&w->screen), - w->screen.hsize, w->screen.hlimit, size); + wl->idx, w->name, w->base.title, ttyname(w->fd), + screen_size_x(&w->base), screen_size_y(&w->base), + w->base.hsize, w->base.hlimit, size); } if (ctx->cmdclient != NULL) diff --git a/cmd-new-session.c b/cmd-new-session.c index 418fbf8e..aff19eab 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-session.c,v 1.18 2007-11-27 19:23:33 nicm Exp $ */ +/* $Id: cmd-new-session.c,v 1.19 2007-12-06 09:46:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -44,7 +44,7 @@ const struct cmd_entry cmd_new_session_entry = { "[-d] [-s session-name] [-n window-name] [command]", CMD_STARTSERVER|CMD_NOCLIENT|CMD_NOSESSION|CMD_CANTNEST, cmd_new_session_parse, - cmd_new_session_exec, + cmd_new_session_exec, cmd_new_session_send, cmd_new_session_recv, cmd_new_session_free @@ -76,7 +76,7 @@ cmd_new_session_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 0 && argc != 1) @@ -90,7 +90,7 @@ cmd_new_session_parse(void **ptr, int argc, char **argv, char **cause) usage: usage(cause, "%s %s", cmd_new_session_entry.name, cmd_new_session_entry.usage); - + cmd_new_session_free(data); return (-1); } @@ -103,7 +103,7 @@ cmd_new_session_exec(void *ptr, struct cmd_ctx *ctx) struct client *c = ctx->cmdclient; char *cmd, *cause; u_int sy; - + if (data == NULL) data = &std; diff --git a/cmd-new-window.c b/cmd-new-window.c index 730c0293..71d922f3 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-window.c,v 1.13 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-new-window.c,v 1.14 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -44,7 +44,7 @@ const struct cmd_entry cmd_new_window_entry = { "new-window", "neww", "[-d] [-i index] [-n name] [command]", CMD_NOCLIENT, cmd_new_window_parse, - cmd_new_window_exec, + cmd_new_window_exec, cmd_new_window_send, cmd_new_window_recv, cmd_new_window_free @@ -81,7 +81,7 @@ cmd_new_window_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 0 && argc != 1) @@ -111,7 +111,7 @@ cmd_new_window_exec(void *ptr, struct cmd_ctx *ctx) if (data == NULL) data = &std; - + cmd = data->cmd; if (cmd == NULL) cmd = default_command; @@ -128,7 +128,7 @@ cmd_new_window_exec(void *ptr, struct cmd_ctx *ctx) server_redraw_session(ctx->session); } else server_status_session(ctx->session); - + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-next-window.c b/cmd-next-window.c index 8a807714..4495558e 100644 --- a/cmd-next-window.c +++ b/cmd-next-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-next-window.c,v 1.5 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-next-window.c,v 1.6 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -45,8 +45,8 @@ cmd_next_window_exec(unused void *ptr, struct cmd_ctx *ctx) if (session_next(ctx->session) == 0) server_redraw_session(ctx->session); else - ctx->error(ctx, "no next window"); - + ctx->error(ctx, "no next window"); + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-paste-buffer.c b/cmd-paste-buffer.c index b4bdf324..349feb48 100644 --- a/cmd-paste-buffer.c +++ b/cmd-paste-buffer.c @@ -1,4 +1,4 @@ -/* $Id: cmd-paste-buffer.c,v 1.1 2007-11-23 17:52:54 nicm Exp $ */ +/* $Id: cmd-paste-buffer.c,v 1.2 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -34,7 +34,7 @@ const struct cmd_entry cmd_paste_buffer_entry = { "paste-buffer", NULL, "paste", CMD_NOCLIENT, NULL, - cmd_paste_buffer_exec, + cmd_paste_buffer_exec, NULL, NULL, NULL diff --git a/cmd-previous-window.c b/cmd-previous-window.c index cdf0b7d8..d0423998 100644 --- a/cmd-previous-window.c +++ b/cmd-previous-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-previous-window.c,v 1.5 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-previous-window.c,v 1.6 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -45,8 +45,8 @@ cmd_previous_window_exec(unused void *ptr, struct cmd_ctx *ctx) if (session_previous(ctx->session) == 0) server_redraw_session(ctx->session); else - ctx->error(ctx, "no previous window"); - + ctx->error(ctx, "no previous window"); + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-rename-session.c b/cmd-rename-session.c index ae28eec6..498bacd2 100644 --- a/cmd-rename-session.c +++ b/cmd-rename-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-rename-session.c,v 1.3 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-rename-session.c,v 1.4 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -41,7 +41,7 @@ const struct cmd_entry cmd_rename_session_entry = { "rename-session", "rename", "new-name", CMD_NOCLIENT, cmd_rename_session_parse, - cmd_rename_session_exec, + cmd_rename_session_exec, cmd_rename_session_send, cmd_rename_session_recv, cmd_rename_session_free @@ -61,7 +61,7 @@ cmd_rename_session_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 1) @@ -89,7 +89,7 @@ cmd_rename_session_exec(void *ptr, struct cmd_ctx *ctx) xfree(ctx->session->name); ctx->session->name = xstrdup(data->newname); - + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-rename-window.c b/cmd-rename-window.c index ba2f4fad..5ed0c161 100644 --- a/cmd-rename-window.c +++ b/cmd-rename-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-rename-window.c,v 1.13 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-rename-window.c,v 1.14 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -42,7 +42,7 @@ const struct cmd_entry cmd_rename_window_entry = { "rename-window", "renamew", "[-i index] new-name", CMD_NOCLIENT, cmd_rename_window_parse, - cmd_rename_window_exec, + cmd_rename_window_exec, cmd_rename_window_send, cmd_rename_window_recv, cmd_rename_window_free @@ -71,7 +71,7 @@ cmd_rename_window_parse(void **ptr, int argc, char **argv, char **cause) default: goto usage; } - } + } argc -= optind; argv += optind; if (argc != 1) @@ -110,7 +110,7 @@ cmd_rename_window_exec(void *ptr, struct cmd_ctx *ctx) wl->window->name = xstrdup(data->newname); server_status_session(ctx->session); - + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } diff --git a/cmd-scroll-mode.c b/cmd-scroll-mode.c index 17d839ae..5bdf5bb6 100644 --- a/cmd-scroll-mode.c +++ b/cmd-scroll-mode.c @@ -1,4 +1,4 @@ -/* $Id: cmd-scroll-mode.c,v 1.4 2007-11-27 19:23:33 nicm Exp $ */ +/* $Id: cmd-scroll-mode.c,v 1.5 2007-12-06 09:46:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -33,7 +33,7 @@ const struct cmd_entry cmd_scroll_mode_entry = { "scroll-mode", NULL, "", CMD_NOCLIENT, NULL, - cmd_scroll_mode_exec, + cmd_scroll_mode_exec, |