From a362c964dea58b1a20a3e042c01001b497553ae9 Mon Sep 17 00:00:00 2001 From: Edward Samson Date: Wed, 20 Nov 2019 13:57:33 +0800 Subject: [PATCH] Use exec to launch when not in cygwin This allows, for example, capturing the correct PID when launching sbt from within a bash script. The original change from 1a0715056050469b5b713d11d635f782b829f7bf was to address an issue specific to cygwin. --- src/universal/bin/sbt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/universal/bin/sbt b/src/universal/bin/sbt index a95e916af..4240311da 100755 --- a/src/universal/bin/sbt +++ b/src/universal/bin/sbt @@ -118,9 +118,13 @@ execRunner () { echo "" } - # This used to be exec, but we loose the ability to re-hook stty then - # for cygwin... Maybe we should flag the feature here... - "$@" + if [[ "$CYGWIN_FLAG" == "true" ]]; then + # In cygwin we loose the ability to re-hook stty if exec is used + # https://github.com/sbt/sbt-launcher-package/issues/53 + "$@" + else + exec "$@" + fi } addJava () {