summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorBob Beck <beck@openbsd.org>2010-04-04 23:05:15 +0000
committerBob Beck <beck@openbsd.org>2010-04-04 23:05:15 +0000
commit6704c863015a8c797796db379b89618e02d277b1 (patch)
tree222b0cae254a007f0fa88a274be3af42f3bc08ac /screen.c
parent680f920b551c0cac9239d6b15ac390dc1bc576b4 (diff)
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. ok nicm@
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 56dbbf37..a22b0f34 100644
--- a/screen.c
+++ b/screen.c
@@ -31,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;