summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index 92cd897e8c7..81675b897d9 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.73 2011/04/18 19:49:05 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.74 2011/04/24 21:32:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -410,6 +410,13 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
fatal("gethostname failed");
ptr = tmp;
goto do_replace;
+ case 'h':
+ if (gethostname(tmp, sizeof tmp) != 0)
+ fatal("gethostname failed");
+ if ((ptr = strchr(tmp, '.')) != NULL)
+ *ptr = '\0';
+ ptr = tmp;
+ goto do_replace;
case 'I':
xsnprintf(tmp, sizeof tmp, "%d", wl->idx);
ptr = tmp;