diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2010-04-04 23:05:16 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2010-04-04 23:05:16 +0000 |
commit | 7fecd3ed30289554188e3c59afca7f94fbd7c11e (patch) | |
tree | 444d36ead41907328067a761fb984fd2c3f1ed89 /usr.bin | |
parent | 12c344d5ee0ed4e7bcce996cce7d8b1295b6cfa8 (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 'usr.bin')
-rw-r--r-- | usr.bin/tmux/screen.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c index cf9f50a6a57..e768bbc37d7 100644 --- a/usr.bin/tmux/screen.c +++ b/usr.bin/tmux/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.14 2010/02/06 17:35:01 nicm Exp $ */ +/* $OpenBSD: screen.c,v 1.15 2010/04/04 23:05:15 beck Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |