kill-window seems over eager

2014-05-08 Thread David Chelimsky
I've got a bash script with a function that opens a number of windows,
killing them first to avoid creating more than one of the same window:

tmux kill-window -t "${TMUX_SESSION}:${name}"
tmux new-window -k -n "$name" -t "${TMUX_SESSION}" "$cmd"

This function gets called with names like "Project DB", "Project", in that
order. The problem is that kill-window appears to be using some sort of
fuzzy matching on the name, so when called with "Project", it kills the
"Project DB" window that was created by the previous invocation of this
function

I don't see a way of telling kill-window to match the name precisely. Is
there one? Any other recommendations (besides using different names or a
different order)?

Thanks,
David
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: kill-window seems over eager

2014-05-08 Thread David Chelimsky
Thanks, Nicholas. Very helpful.


On Thu, May 8, 2014 at 8:57 AM, Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:

> Yes, that's how it works. It was meant for convenience but it's probably
> not that useful. Still, it's there now.
>
> It'd be nice to have an exact-match-only flag or something but at the
> moment you can use the window id - something like:
>
> x=$(tmux lsw -F'#{window_id},#{window_name}'|awk -F, '/,Project DB$/
> {print $1}')
> [ -n "$x" ] && tmux killw -t$x
>
>
> On Thu, May 08, 2014 at 08:35:37AM -0400, David Chelimsky wrote:
> >I've got a bash script with a function that opens a number of windows,
> >killing them first to avoid creating more than one of the same window:
> >tmux kill-window -t "${TMUX_SESSION}:${name}"
> >tmux new-window -k -n "$name" -t "${TMUX_SESSION}" "$cmd"
> >This function gets called with names like "Project DB", "Project", in
> that
> >order. The problem is that kill-window appears to be using some sort
> of
> >fuzzy matching on the name, so when called with "Project", it kills
> the
> >"Project DB" window that was created by the previous invocation of
> this
> >function
> >I don't see a way of telling kill-window to match the name precisely.
> Is
> >there one? Any other recommendations (besides using different names
> or a
> >different order)?
> >Thanks,
> >David
>
> >
> --
> > Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> > • 3 signs your SCM is hindering your productivity
> > • Requirements for releasing software faster
> > • Expert tips and advice for migrating your SCM now
> > http://p.sf.net/sfu/perforce
>
> > ___
> > tmux-users mailing list
> > tmux-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tmux-users
>
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users