aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild/sbt28
-rwxr-xr-xbuild/sbt-launch-lib.bash2
2 files changed, 29 insertions, 1 deletions
diff --git a/build/sbt b/build/sbt
index 28ebb64f71..cc3203d79b 100755
--- a/build/sbt
+++ b/build/sbt
@@ -125,4 +125,32 @@ loadConfigFile() {
[[ -f "$etc_sbt_opts_file" ]] && set -- $(loadConfigFile "$etc_sbt_opts_file") "$@"
[[ -f "$sbt_opts_file" ]] && set -- $(loadConfigFile "$sbt_opts_file") "$@"
+exit_status=127
+saved_stty=""
+
+restoreSttySettings() {
+ stty $saved_stty
+ saved_stty=""
+}
+
+onExit() {
+ if [[ "$saved_stty" != "" ]]; then
+ restoreSttySettings
+ fi
+ exit $exit_status
+}
+
+saveSttySettings() {
+ saved_stty=$(stty -g 2>/dev/null)
+ if [[ ! $? ]]; then
+ saved_stty=""
+ fi
+}
+
+saveSttySettings
+trap onExit INT
+
run "$@"
+
+exit_status=$?
+onExit
diff --git a/build/sbt-launch-lib.bash b/build/sbt-launch-lib.bash
index 5e0c640fa5..504be48b35 100755
--- a/build/sbt-launch-lib.bash
+++ b/build/sbt-launch-lib.bash
@@ -81,7 +81,7 @@ execRunner () {
echo ""
}
- exec "$@"
+ "$@"
}
addJava () {