mirror of
https://github.com/tmate-io/tmate.git
synced 2026-07-25 20:04:02 +00:00
Look up indexes as number before name, makes more sense if windows are
named starting with numbers. From Thomas Adam.
This commit is contained in:
parent
69f292a90e
commit
3909aff06a
1 changed files with 4 additions and 4 deletions
8
cmd.c
8
cmd.c
|
|
@ -781,15 +781,15 @@ cmd_lookup_index(struct session *s, const char *name, int *ambiguous)
|
|||
const char *errstr;
|
||||
u_int idx;
|
||||
|
||||
idx = strtonum(name, 0, INT_MAX, &errstr);
|
||||
if (errstr == NULL)
|
||||
return (idx);
|
||||
|
||||
if ((wl = cmd_lookup_window(s, name, ambiguous)) != NULL)
|
||||
return (wl->idx);
|
||||
if (*ambiguous)
|
||||
return (-1);
|
||||
|
||||
idx = strtonum(name, 0, INT_MAX, &errstr);
|
||||
if (errstr == NULL)
|
||||
return (idx);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue