From b5865a6d2967733b67acf6a25e5eb1514122d50c Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 6 Oct 2026 17:42:14 +0100 Subject: [PATCH] Use current state. --- cmd-invoke.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd-invoke.c b/cmd-invoke.c index d47649bc0..e0fcab448 100644 --- a/cmd-invoke.c +++ b/cmd-invoke.c @@ -253,11 +253,20 @@ cmd_invoke_is_true(struct cmdq_item *item, struct cmd_invoke_state *is, struct cmd_parse_node *node, int *result) { struct format_tree *ft; + struct cmd_find_state *current, fs; + struct client *c; char *s, *expanded; if (cmd_invoke_expand_string(item, is, node, &s) != 0) return (-1); - ft = format_create_from_target(item); + c = cmd_find_client(item, NULL, 1); + current = cmdq_get_current(item); + if (!cmd_find_valid_state(current)) { + cmd_find_from_client(&fs, c, 0); + current = &fs; + } + ft = format_create(c, item, FORMAT_NONE, FORMAT_NOJOBS); + format_defaults(ft, c, current->s, current->wl, current->wp); expanded = format_expand(ft, s); *result = format_true(expanded);