aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgahr <gahr@FreeBSD.org>2011-07-11 18:49:06 +0800
committergahr <gahr@FreeBSD.org>2011-07-11 18:49:06 +0800
commit7a9b46b42f914323bd73479ae7d41e086dac8835 (patch)
treee6df98db1bde3632e942531350411f0cb09efe4e
parent5f2d74f57d530fe08f56610843f6103f1cd0ef60 (diff)
downloadfreebsd-ports-gnome-7a9b46b42f914323bd73479ae7d41e086dac8835.tar.gz
freebsd-ports-gnome-7a9b46b42f914323bd73479ae7d41e086dac8835.tar.zst
freebsd-ports-gnome-7a9b46b42f914323bd73479ae7d41e086dac8835.zip
- add support for the #h status line special char to print to hostname of the
localhost without the domain name PR: 158796 Submitted by: gahr@FreeBSD.org Approved by: wen@ (maintainer)
-rw-r--r--sysutils/tmux/Makefile2
-rw-r--r--sysutils/tmux/files/patch-hostname.diff32
2 files changed, 33 insertions, 1 deletions
diff --git a/sysutils/tmux/Makefile b/sysutils/tmux/Makefile
index 5631be345463..17e46fc04f22 100644
--- a/sysutils/tmux/Makefile
+++ b/sysutils/tmux/Makefile
@@ -14,7 +14,7 @@ MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
MAINTAINER= wen@FreeBSD.org
COMMENT= A Terminal Multiplexer
-LICENSE= BSD
+LICENSE= BSD
HAS_CONFIGURE= yes
diff --git a/sysutils/tmux/files/patch-hostname.diff b/sysutils/tmux/files/patch-hostname.diff
new file mode 100644
index 000000000000..a8eedf929277
--- /dev/null
+++ b/sysutils/tmux/files/patch-hostname.diff
@@ -0,0 +1,32 @@
+--- status.c.orig 2011/04/18 20:49:05 1.73
++++ status.c 2011/04/24 22:32:07 1.74
+@@ -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>
+@@ -408,6 +408,13 @@ status_replace1(struct client *c, struct session *s, s
+ case 'H':
+ if (gethostname(tmp, sizeof tmp) != 0)
+ 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':
+--- tmux.1.orig 2011/04/19 22:31:33 1.223
++++ tmux.1 2011/04/24 22:32:07 1.224
+@@ -2005,6 +2005,7 @@ may contain any of the following special character seq
+ .It Li "#(shell-command)" Ta "First line of the command's output"
+ .It Li "#[attributes]" Ta "Colour or attribute change"
+ .It Li "#H" Ta "Hostname of local host"
++.It Li "#h" Ta "Hostname of local host without the domain name"
+ .It Li "#F" Ta "Current window flag"
+ .It Li "#I" Ta "Current window index"
+ .It Li "#P" Ta "Current pane index"