summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/format.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-12-11 12:27:37 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-12-11 12:27:37 +0000
commit0acd6a362b41e985e864a92e9bee8ab3fbd9adf2 (patch)
treefad1146ee3386cdfd875e6f8ae3acaedc0cafac5 /usr.bin/tmux/format.c
parent40d0fa54b40f910b6d5b9a7861c60f78582b52d8 (diff)
Add cmdq as an argument to format_create and add a format for the
command name (will also be used for more later).
Diffstat (limited to 'usr.bin/tmux/format.c')
-rw-r--r--usr.bin/tmux/format.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index e695f657ec5..818242eb0fd 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.101 2015/12/08 08:34:18 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.102 2015/12/11 12:27:36 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -465,7 +465,7 @@ format_cb_pane_tabs(struct format_tree *ft, struct format_entry *fe)
/* Create a new tree. */
struct format_tree *
-format_create(int flags)
+format_create(struct cmd_q *cmdq, int flags)
{
struct format_tree *ft;
@@ -484,6 +484,9 @@ format_create(int flags)
format_add(ft, "socket_path", "%s", socket_path);
format_add_tv(ft, "start_time", &start_time);
+ if (cmdq != NULL && cmdq->cmd != NULL)
+ format_add(ft, "command_name", "%s", cmdq->cmd->entry->name);
+
return (ft);
}