aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorFelipe Trzaskowski <felipe.trzaskowski@gmail.com>2021-03-12 23:46:55 +0000
committerFelipe Trzaskowski <felipe.trzaskowski@gmail.com>2021-03-13 08:48:55 +0000
commit3ed93142667f052909beae43463501df37a4dcca (patch)
treee0db226a9eb0b9c9c41c26633fb8995508ecd4c6 /client.c
parentclient: repair usage output (diff)
add option to detach the client process from the terminal instance
Diffstat (limited to 'client.c')
-rw-r--r--client.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/client.c b/client.c
index 14893a53..975269b1 100644
--- a/client.c
+++ b/client.c
@@ -58,6 +58,7 @@ print_usage(const char *prog_name)
" -D,--working-directory=DIR directory to start in (CWD)\n"
" -s,--server-socket=PATH path to the server UNIX domain socket (default=$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock)\n"
" -H,--hold remain open after child process exits\n"
+ " -N,--no-wait detach the client process from the running terminal, exiting immediately\n"
" -d,--log-level={info|warning|error} log level (info)\n"
" -l,--log-colorize=[{never|always|auto}] enable/disable colorization of log output on stderr\n"
" -v,--version show the version number and quit\n");
@@ -82,6 +83,7 @@ main(int argc, char *const *argv)
{"working-directory", required_argument, NULL, 'D'},
{"server-socket", required_argument, NULL, 's'},
{"hold", no_argument, NULL, 'H'},
+ {"no-wait", no_argument, NULL, 'N'},
{"log-level", required_argument, NULL, 'd'},
{"log-colorize", optional_argument, NULL, 'l'},
{"version", no_argument, NULL, 'v'},
@@ -103,9 +105,10 @@ main(int argc, char *const *argv)
bool maximized = false;
bool fullscreen = false;
bool hold = false;
+ bool no_wait = false;
while (true) {
- int c = getopt_long(argc, argv, "+t:T:a:w:W:mFLD:s:Hd:l::vh", longopts, NULL);
+ int c = getopt_long(argc, argv, "+t:T:a:w:W:mFLD:s:HNd:l::vh", longopts, NULL);
if (c == -1)
break;
@@ -170,6 +173,10 @@ main(int argc, char *const *argv)
hold = true;
break;
+ case 'N':
+ no_wait = true;
+ break;
+
case 'd': {
int lvl = log_level_from_string(optarg);
if (unlikely(lvl < 0)) {
@@ -290,6 +297,7 @@ main(int argc, char *const *argv)
.fullscreen = fullscreen,
.hold = hold,
.login_shell = login_shell,
+ .no_wait = no_wait,
.cwd_len = cwd_len,
.term_len = term_len,
.title_len = title_len,