aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--status.c9
-rw-r--r--tmux.15
2 files changed, 11 insertions, 3 deletions
diff --git a/status.c b/status.c
index a8beed3b..307aef1e 100644
--- a/status.c
+++ b/status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.158 2011-04-18 21:07:58 nicm Exp $ */
+/* $Id: status.c,v 1.159 2011-04-25 20:35:22 tcunha 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;
diff --git a/tmux.1 b/tmux.1
index e353beb4..a69d9f51 100644
--- a/tmux.1
+++ b/tmux.1
@@ -1,4 +1,4 @@
-.\" $Id: tmux.1,v 1.309 2011-04-25 20:33:42 tcunha Exp $
+.\" $Id: tmux.1,v 1.310 2011-04-25 20:35:22 tcunha Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 19 2011 $
+.Dd $Mdocdate: April 24 2011 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -2009,6 +2009,7 @@ may contain any of the following special character sequences:
.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"