[BACK]Return to server.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/server.c between version 1.37 and 1.38

version 1.37, 2009/09/15 07:45:16 version 1.38, 2009/09/18 15:19:27
Line 66 
Line 66 
 void             server_lost_client(struct client *);  void             server_lost_client(struct client *);
 void             server_check_window(struct window *);  void             server_check_window(struct window *);
 void             server_check_redraw(struct client *);  void             server_check_redraw(struct client *);
   void             server_set_title(struct client *);
 void             server_redraw_locked(struct client *);  void             server_redraw_locked(struct client *);
 void             server_check_timers(struct client *);  void             server_check_timers(struct client *);
 void             server_second_timers(void);  void             server_second_timers(void);
Line 516 
Line 517 
 {  {
         struct session          *s;          struct session          *s;
         struct window_pane      *wp;          struct window_pane      *wp;
         char                     title[512];  
         int                      flags, redraw;          int                      flags, redraw;
   
         if (c == NULL || c->session == NULL)          if (c == NULL || c->session == NULL)
Line 526 
Line 526 
         flags = c->tty.flags & TTY_FREEZE;          flags = c->tty.flags & TTY_FREEZE;
         c->tty.flags &= ~TTY_FREEZE;          c->tty.flags &= ~TTY_FREEZE;
   
         if (options_get_number(&s->options, "set-titles")) {  
                 xsnprintf(title, sizeof title, "%s:%u:%s - \"%s\"",  
                     s->name, s->curw->idx, s->curw->window->name,  
                     s->curw->window->active->screen->title);  
                 if (c->title == NULL || strcmp(title, c->title) != 0) {  
                         if (c->title != NULL)  
                                 xfree(c->title);  
                         c->title = xstrdup(title);  
                         tty_set_title(&c->tty, c->title);  
                 }  
         }  
   
         if (c->flags & (CLIENT_REDRAW|CLIENT_STATUS)) {          if (c->flags & (CLIENT_REDRAW|CLIENT_STATUS)) {
                   if (options_get_number(&s->options, "set-titles"))
                           server_set_title(c);
   
                 if (c->message_string != NULL)                  if (c->message_string != NULL)
                         redraw = status_message_redraw(c);                          redraw = status_message_redraw(c);
                 else if (c->prompt_string != NULL)                  else if (c->prompt_string != NULL)
Line 568 
Line 559 
         c->tty.flags |= flags;          c->tty.flags |= flags;
   
         c->flags &= ~(CLIENT_REDRAW|CLIENT_STATUS);          c->flags &= ~(CLIENT_REDRAW|CLIENT_STATUS);
   }
   
   /* Set client title. */
   void
   server_set_title(struct client *c)
   {
           struct session  *s = c->session;
           const char      *template;
           char            *title;
   
           template = options_get_string(&s->options, "set-titles-string");
   
           title = status_replace(c->session, template, time(NULL));
           if (c->title == NULL || strcmp(title, c->title) != 0) {
                   if (c->title != NULL)
                           xfree(c->title);
                   c->title = xstrdup(title);
                   tty_set_title(&c->tty, c->title);
           }
           xfree(title);
 }  }
   
 /* Redraw client when locked. */  /* Redraw client when locked. */

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38