X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=fa5253371a548e5473193ba92e184d5454b0f8a0;hb=5567c0d4107e6ff6f4639d8664651841bd59ddad;hp=a5152592d1631a039b85ea581112cce718870d24;hpb=a57db1dfe0736fd902a45ed5f695630faf3f0e1e;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index a5152592..fa525337 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1916,7 +1916,7 @@ static int cmd_shell(int argc, char *argv[]) { } #else if(tty) - fputs(stdout, prompt); + fputs(prompt, stdout); line = fgets(buf, sizeof buf, stdin); #endif @@ -1951,6 +1951,9 @@ static int cmd_shell(int argc, char *argv[]) { if(nargc == argc) continue; + if(!strcasecmp(nargv[argc], "exit") || !strcasecmp(nargv[argc], "quit")) + return result; + bool found = false; for(int i = 0; commands[i].command; i++) { @@ -1962,7 +1965,7 @@ static int cmd_shell(int argc, char *argv[]) { } #ifdef HAVE_READLINE - if(found) + if(tty && found) add_history(copy); #endif