Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem distinguishing between sessions named '1' and '10' #346

Closed
fawind opened this issue Mar 24, 2016 · 3 comments
Closed

Problem distinguishing between sessions named '1' and '10' #346

fawind opened this issue Mar 24, 2016 · 3 comments

Comments

@fawind
Copy link

fawind commented Mar 24, 2016

I have a session named '10' (and no session named '1'). The command tmux has-session -t 1 returns true. In addition to this tmux switch-client -t 1 switches to session 10.

This only happens if session '1' does not exist. Trying the same thing with an existing session '1' and a missing session '10' works fine.

I am using tmux 2.1.

@nicm
Copy link
Member

nicm commented Mar 24, 2016

You can use = for exact match.

@nicm nicm closed this as completed Mar 24, 2016
@ThomasAdam
Copy link
Contributor

Correct. This is intended default behaviour. For your purposes, see:

tmux whatever -t=10

serban added a commit to serban/dotfiles that referenced this issue Nov 12, 2018
See tmux/tmux#346.

From the tmux man page:

target-session is tried as, in order:

  1.   A session ID prefixed with a $.

  2.   An exact name of a session (as listed by the list-sessions
       command).

  3.   The start of a session name, for example `mysess' would match a
       session named `mysession'.

  4.   An fnmatch(3) pattern which is matched against the session name.

If the session name is prefixed with an `=', only an exact match is
accepted (so `=mysess' will only match exactly `mysess', not
`mysession').

If a single session is found, it is used as the target session; multiple
matches produce an error.  If a session is omitted, the current session
is used if available; if no cur- rent session is available, the most
recently used is chosen.
@lock
Copy link

lock bot commented Feb 16, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants