Thanks, this patch worked! Formats are now expanded in `-n` argument.
On Mon, 30 Dec 2019 13:12:39 +0000, Nicholas Marriott wrote:
> It must have got lost when I moved everything to spawn.c. Try this
> please:
>
> Index: spawn.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/tmux/spawn.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 spawn.c
> --- spawn.c 28 Nov 2019 09:45:16 -0000 1.12
> +++ spawn.c 30 Dec 2019 13:12:04 -0000
> @@ -80,6 +80,8 @@ spawn_log(const char *from, struct spawn
> struct winlink *
> spawn_window(struct spawn_context *sc, char **cause)
> {
> + struct cmdq_item *item = sc->item;
> + struct client *c = item->client;
> struct session *s = sc->s;
> struct window *w;
> struct window_pane *wp;
> @@ -182,7 +184,8 @@ spawn_window(struct spawn_context *sc, c
> /* Set the name of the new window. */
> if (~sc->flags & SPAWN_RESPAWN) {
> if (sc->name != NULL) {
> - w->name = xstrdup(sc->name);
> + w->name = format_single(item, sc->name, c,
> s, NULL,
> + NULL);
> options_set_number(w->options,
> "automatic-rename", 0); } else
> w->name = xstrdup(default_window_name(w));
>
>
> On Sun, Dec 29, 2019 at 06:38:52PM -0800, Suraj N. Kurapati wrote:
> > Hello,
> >
> > In the latest tmux 3.0a release (and possibly in a few prior
> > releases), the `new-window` command isn't expanding formats in the
> > `-n` argument.
> >
> > I use this feature to insert the session, window, and pane ID of the
> > currently active window into the name of the new window as follows:
> >
> > new-window -n '#S:#I.#P' -a '...shell command goes here...'
> >
> > Was this feature removed deliberately? The CHANGES file doesn't
> > say.
> >
> > Also, I searched through the git logs and found that this feature
> > was added on March 1, 2018 as "Expand formats in window and session
> > names." in commit 182357f24bc7e16d7d7c85cab0c61974f18df2e7.
> >
> > Thanks for your consideration.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "tmux-users" group. To unsubscribe from this group and stop
> > receiving emails from it, send an email to
> > [email protected]. To view this discussion on
> > the web, visit
> > https://groups.google.com/d/msgid/tmux-users/20191229183852.2580a2c6%40ratham.
>
> -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/20191230172953.35462dea%40ratham.attlocal.net.
pgpdDA8jyoU9p.pgp
Description: OpenPGP digital signature
