mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 02:48:47 +00:00
Show an error if cmd_find_session can't find the current session, like
the other functions.
This commit is contained in:
parent
2b67907176
commit
c5253ad8f7
11
cmd.c
11
cmd.c
@ -795,8 +795,11 @@ cmd_find_session(struct cmd_q *cmdq, const char *arg, int prefer_unattached)
|
|||||||
int ambiguous;
|
int ambiguous;
|
||||||
|
|
||||||
/* A NULL argument means the current session. */
|
/* A NULL argument means the current session. */
|
||||||
if (arg == NULL)
|
if (arg == NULL) {
|
||||||
return (cmd_current_session(cmdq, prefer_unattached));
|
if ((s = cmd_current_session(cmdq, prefer_unattached)) == NULL)
|
||||||
|
cmdq_error(cmdq, "can't establish current session");
|
||||||
|
return (s);
|
||||||
|
}
|
||||||
|
|
||||||
/* Lookup as pane id or window id. */
|
/* Lookup as pane id or window id. */
|
||||||
if ((wp = cmd_lookup_paneid(arg)) != NULL)
|
if ((wp = cmd_lookup_paneid(arg)) != NULL)
|
||||||
@ -813,7 +816,9 @@ cmd_find_session(struct cmd_q *cmdq, const char *arg, int prefer_unattached)
|
|||||||
/* An empty session name is the current session. */
|
/* An empty session name is the current session. */
|
||||||
if (*tmparg == '\0') {
|
if (*tmparg == '\0') {
|
||||||
free(tmparg);
|
free(tmparg);
|
||||||
return (cmd_current_session(cmdq, prefer_unattached));
|
if ((s = cmd_current_session(cmdq, prefer_unattached)) == NULL)
|
||||||
|
cmdq_error(cmdq, "can't establish current session");
|
||||||
|
return (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the session, if any. */
|
/* Find the session, if any. */
|
||||||
|
Loading…
Reference in New Issue
Block a user