Add -N flag to never start server even if command would normally do so,

GitHub issue 2523.
This commit is contained in:
nicm
2021-01-17 16:17:41 +00:00
parent a75aca4d6a
commit 71c590a37f
4 changed files with 13 additions and 3 deletions

7
tmux.c
View File

@ -57,7 +57,7 @@ static __dead void
usage(void)
{
fprintf(stderr,
"usage: %s [-2CDluvV] [-c shell-command] [-f file] [-L socket-name]\n"
"usage: %s [-2CDlNuvV] [-c shell-command] [-f file] [-L socket-name]\n"
" [-S socket-path] [-T features] [command [flags]]\n",
getprogname());
exit(1);
@ -350,7 +350,7 @@ main(int argc, char **argv)
if (**argv == '-')
flags = CLIENT_LOGIN;
while ((opt = getopt(argc, argv, "2c:CDdf:lL:qS:T:uUvV")) != -1) {
while ((opt = getopt(argc, argv, "2c:CDdf:lL:NqS:T:uUvV")) != -1) {
switch (opt) {
case '2':
tty_add_features(&feat, "256", ":,");
@ -380,6 +380,9 @@ main(int argc, char **argv)
free(label);
label = xstrdup(optarg);
break;
case 'N':
flags |= CLIENT_NOSTARTSERVER;
break;
case 'q':
break;
case 'S':