=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-kill-window.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** src/usr.bin/tmux/cmd-kill-window.c 2009/07/15 08:00:49 1.3 --- src/usr.bin/tmux/cmd-kill-window.c 2009/07/17 20:37:03 1.4 *************** *** 1,4 **** ! /* $OpenBSD: cmd-kill-window.c,v 1.3 2009/07/15 08:00:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-kill-window.c,v 1.4 2009/07/17 20:37:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 44,80 **** { struct cmd_target_data *data = self->data; struct winlink *wl; - struct window *w; - struct session *s; - struct client *c; - u_int i, j; - int destroyed; if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); - w = wl->window; ! for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { ! s = ARRAY_ITEM(&sessions, i); ! if (s == NULL || !session_has(s, w)) ! continue; ! if ((wl = winlink_find_by_window(&s->windows, w)) == NULL) ! continue; ! ! destroyed = session_detach(s, wl); ! for (j = 0; j < ARRAY_LENGTH(&clients); j++) { ! c = ARRAY_ITEM(&clients, j); ! if (c == NULL || c->session != s) ! continue; ! ! if (destroyed) { ! c->session = NULL; ! server_write_client(c, MSG_EXIT, NULL, 0); ! } else ! server_redraw_client(c); ! } ! } ! recalculate_sizes(); return (0); } --- 44,54 ---- { struct cmd_target_data *data = self->data; struct winlink *wl; if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); ! server_kill_window(wl->window); return (0); }