From af4bd3dea2ad23561655a0b73dbee20b4c86d5ce Mon Sep 17 00:00:00 2001 From: jfgordon2 <55799997+jfgordon2@users.noreply.github.com> Date: Mon, 30 Mar 2020 12:23:37 -0500 Subject: [PATCH] Detach CLI process from terminal (#239) --- app/static/linux/github | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/static/linux/github b/app/static/linux/github index dfb32bf6ea4..0f7513eb244 100644 --- a/app/static/linux/github +++ b/app/static/linux/github @@ -23,6 +23,13 @@ fi ELECTRON="$GITHUB_PATH/$BINARY_NAME" CLI="$GITHUB_PATH/resources/app/cli.js" -ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" +case $1 in + # if help in the first variable, return contents to shell + *help*|*--help*) + ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@";; + # any other, redirect to /dev/null to detach from controlling terminal + *) + ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" < /dev/null > /dev/null &;; +esac exit $?