diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2010-04-06 22:01:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2010-04-06 22:01:32 +0000 |
commit | 3743238a8610b192412e9d3cced18d990aef590c (patch) | |
tree | b2012c9f374c5e93f87091ad35db219c61d026f7 /screen.c | |
parent | 531db321e3640ef38dc7e54d13ecf97cb91507d3 (diff) | |
download | rtmux-3743238a8610b192412e9d3cced18d990aef590c.tar.gz rtmux-3743238a8610b192412e9d3cced18d990aef590c.tar.bz2 rtmux-3743238a8610b192412e9d3cced18d990aef590c.zip |
From Bob Beck:
rather than using an empty "" as the default window title, put the hostname
of the machine we are running on in there.
makes my many green lines easier to deal with without using fiddly options to
set it.
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.100 2010-04-05 05:11:44 micahcowan Exp $ */ +/* $Id: screen.c,v 1.101 2010-04-06 22:01:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -20,6 +20,7 @@ #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "tmux.h" @@ -30,9 +31,14 @@ void screen_resize_y(struct screen *, u_int); void screen_init(struct screen *s, u_int sx, u_int sy, u_int hlimit) { + char hn[MAXHOSTNAMELEN]; + s->grid = grid_create(sx, sy, hlimit); - s->title = xstrdup(""); + if (gethostname(hn, MAXHOSTNAMELEN) == 0) + s->title = xstrdup(hn); + else + s->title = xstrdup(""); s->tabs = NULL; |