Revision: 2596
          http://tmux.svn.sourceforge.net/tmux/?rev=2596&view=rev
Author:   tcunha
Date:     2011-09-21 16:35:13 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
Sync OpenBSD patchset 957:

Mark dead panes with some text saying they are dead, suggested by and
with help from Randy Stauner.

Modified Paths:
--------------
    trunk/server-fn.c

Modified: trunk/server-fn.c
===================================================================
--- trunk/server-fn.c   2011-09-21 16:34:34 UTC (rev 2595)
+++ trunk/server-fn.c   2011-09-21 16:35:13 UTC (rev 2596)
@@ -329,16 +329,32 @@
 void
 server_destroy_pane(struct window_pane *wp)
 {
-       struct window   *w = wp->window;
+       struct window           *w = wp->window;
+       int                      old_fd;
+       struct screen_write_ctx  ctx;
+       struct grid_cell         gc;
 
+       old_fd = wp->fd;
        if (wp->fd != -1) {
                close(wp->fd);
                bufferevent_free(wp->event);
                wp->fd = -1;
        }
 
-       if (options_get_number(&w->options, "remain-on-exit"))
+       if (options_get_number(&w->options, "remain-on-exit")) {
+               if (old_fd == -1)
+                       return;
+               screen_write_start(&ctx, wp, &wp->base);
+               screen_write_scrollregion(&ctx, 0, screen_size_y(ctx.s) - 1);
+               screen_write_cursormove(&ctx, 0, screen_size_y(ctx.s) - 1);
+               screen_write_linefeed(&ctx, 1);
+               memcpy(&gc, &grid_default_cell, sizeof gc);
+               gc.attr |= GRID_ATTR_BRIGHT;
+               screen_write_puts(&ctx, &gc, "Pane is dead");
+               screen_write_stop(&ctx);
+               wp->flags |= PANE_REDRAW;
                return;
+       }
 
        layout_close_pane(wp);
        window_remove_pane(w, wp);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to