mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-19 01:46:33 +02:00
Provide #h for short hostname (no domain) from Michal Mazurek.
This commit is contained in:
7
status.c
7
status.c
@@ -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;
|
||||
|
Reference in New Issue
Block a user