mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Add a -D flag to ask tmux not to daemonize, useful both for running a
debugger (lldb does not have follow-fork-mode) and for running with a managed supervisor init system. GitHub issue 2190.
This commit is contained in:
9
tmux.c
9
tmux.c
@ -57,7 +57,7 @@ static __dead void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: %s [-2CluvV] [-c shell-command] [-f file] [-L socket-name]\n"
|
||||
"usage: %s [-2CDluvV] [-c shell-command] [-f file] [-L socket-name]\n"
|
||||
" [-S socket-path] [-T features] [command [flags]]\n",
|
||||
getprogname());
|
||||
exit(1);
|
||||
@ -336,7 +336,7 @@ main(int argc, char **argv)
|
||||
if (**argv == '-')
|
||||
flags = CLIENT_LOGIN;
|
||||
|
||||
while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:T:uUvV")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "2c:CDdf:lL:qS:T:uUvV")) != -1) {
|
||||
switch (opt) {
|
||||
case '2':
|
||||
tty_add_features(&feat, "256", ":,");
|
||||
@ -344,6 +344,9 @@ main(int argc, char **argv)
|
||||
case 'c':
|
||||
shell_command = optarg;
|
||||
break;
|
||||
case 'D':
|
||||
flags |= CLIENT_NOFORK;
|
||||
break;
|
||||
case 'C':
|
||||
if (flags & CLIENT_CONTROL)
|
||||
flags |= CLIENT_CONTROLCONTROL;
|
||||
@ -387,6 +390,8 @@ main(int argc, char **argv)
|
||||
|
||||
if (shell_command != NULL && argc != 0)
|
||||
usage();
|
||||
if ((flags & CLIENT_NOFORK) && argc != 0)
|
||||
usage();
|
||||
|
||||
if ((ptm_fd = getptmfd()) == -1)
|
||||
err(1, "getptmfd");
|
||||
|
Reference in New Issue
Block a user