diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-04-13 14:01:45 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-04-13 14:01:45 +0100 |
commit | 8f2b5d714a9f854c9583cab8bae70a2c7323fa00 (patch) | |
tree | 4e887ff4a1fcb3703fb0a1fcaa751183cff24c12 /spawn.c | |
parent | b117c3b81217a11946ac784cfbe2ef1f3725b207 (diff) | |
parent | 04cdd035250b93b728678d515b69690653dced4e (diff) | |
download | rtmux-8f2b5d714a9f854c9583cab8bae70a2c7323fa00.tar.gz rtmux-8f2b5d714a9f854c9583cab8bae70a2c7323fa00.tar.bz2 rtmux-8f2b5d714a9f854c9583cab8bae70a2c7323fa00.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'spawn.c')
-rw-r--r-- | spawn.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -54,10 +54,10 @@ spawn_log(const char *from, struct spawn_context *sc) struct session *s = sc->s; struct winlink *wl = sc->wl; struct window_pane *wp0 = sc->wp0; + const char *name = cmdq_get_name(sc->item); char tmp[128]; - const char *name; - log_debug("%s: %s, flags=%#x", from, sc->item->name, sc->flags); + log_debug("%s: %s, flags=%#x", from, name, sc->flags); if (wl != NULL && wp0 != NULL) xsnprintf(tmp, sizeof tmp, "wl=%d wp0=%%%u", wl->idx, wp0->id); @@ -68,18 +68,14 @@ spawn_log(const char *from, struct spawn_context *sc) else xsnprintf(tmp, sizeof tmp, "wl=none wp0=none"); log_debug("%s: s=$%u %s idx=%d", from, s->id, tmp, sc->idx); - - name = sc->name; - if (name == NULL) - name = "none"; - log_debug("%s: name=%s", from, name); + log_debug("%s: name=%s", from, sc->name == NULL ? "none" : sc->name); } struct winlink * spawn_window(struct spawn_context *sc, char **cause) { struct cmdq_item *item = sc->item; - struct client *c = item->client; + struct client *c = cmdq_get_client(item); struct session *s = sc->s; struct window *w; struct window_pane *wp; @@ -205,7 +201,8 @@ struct window_pane * spawn_pane(struct spawn_context *sc, char **cause) { struct cmdq_item *item = sc->item; - struct client *c = item->client; + struct cmd_find_state *target = cmdq_get_target(item); + struct client *c = cmdq_get_client(item); struct session *s = sc->s; struct window *w = sc->wl->window; struct window_pane *new_wp; @@ -228,9 +225,9 @@ spawn_pane(struct spawn_context *sc, char **cause) * the pane's stored one unless specified. */ if (sc->cwd != NULL) - cwd = format_single(item, sc->cwd, c, item->target.s, NULL, NULL); + cwd = format_single(item, sc->cwd, c, target->s, NULL, NULL); else if (~sc->flags & SPAWN_RESPAWN) - cwd = xstrdup(server_client_get_cwd(c, item->target.s)); + cwd = xstrdup(server_client_get_cwd(c, target->s)); else cwd = NULL; |