Skip to content

Commit 3d723a8

Browse files
committed
fix for various combinations of terminal and shell environment; fix for #11536
1 parent 58c77c3 commit 3d723a8

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

dist/bin/common

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ function onExit() {
2424
}
2525

2626
# to reenable echo if we are interrupted before completing.
27-
trap onExit INT TERM
27+
trap onExit INT TERM EXIT
2828

29-
cygwin=false
30-
mingw=false
31-
msys=false
32-
darwin=false
29+
unset cygwin mingw msys darwin conemu
3330
case "`uname`" in
3431
CYGWIN*) cygwin=true
3532
;;
@@ -51,8 +48,9 @@ case "`uname`" in
5148
esac
5249

5350
unset CYGPATHCMD
54-
if [[ ($cygwin||$mingw||$msys) ]]; then
51+
if [[ $cygwin || $mingw || $msys ]]; then
5552
# cygpath is used by various windows shells: cygwin, git-sdk, gitbash, msys, etc.
53+
[[ ($CONEMUANSI || $ConEmuANSI) ]] && conemu=true
5654
CYGPATHCMD=`which cygpath 2>/dev/null`
5755
case "$TERM" in
5856
rxvt* | xterm* | cygwin*)
@@ -113,7 +111,7 @@ if [ -n "$CYGPATHCMD" ]; then
113111
JAVA_HOME=`"$CYGPATHCMD" -am "$JAVA_HOME"`
114112
CLASSPATH_SUFFIX=";"
115113
PSEP=";"
116-
elif ($mingw || $msys); then
114+
elif [[ $mingw || $msys ]]; then
117115
# For Mingw / Msys, convert paths from UNIX format before anything is touched
118116
[ -n "$PROG_HOME" ] &&
119117
PROG_HOME="`(cd "$PROG_HOME"; pwd -W | sed 's|/|\\\\|g')`"
@@ -131,7 +129,7 @@ find_lib () {
131129
local lib=$(find $PROG_HOME/lib/ -name "$1")
132130
if [ -n "$CYGPATHCMD" ]; then
133131
$CYGPATHCMD -am $lib
134-
elif ($mingw || $msys); then
132+
elif [[ $mingw || $msys ]]; then
135133
echo $lib | sed 's|/|\\\\|g'
136134
else
137135
echo $lib
@@ -150,7 +148,8 @@ SBT_INTF=$(find_lib "*compiler-interface*")
150148
JLINE_READER=$(find_lib "*jline-reader-3*")
151149
JLINE_TERMINAL=$(find_lib "*jline-terminal-3*")
152150
JLINE_TERMINAL_JNA=$(find_lib "*jline-terminal-jna-3*")
153-
[[ ($mingw||$msys) ]] || JNA=$(find_lib "*jna-5*")
154-
151+
# ConEmu must not define
152+
[[ $conemu ]] || JNA=$(find_lib "*jna-5*")
155153
# debug
154+
156155
DEBUG_STR=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005

dist/bin/scalac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ if [ "$PROG_NAME" == "$ScriptingMain" ]; then
120120
scripting_string="-script $target_script ${scripting_args[@]}"
121121
fi
122122

123-
eval exec "\"$JAVACMD\"" \
123+
eval "\"$JAVACMD\"" \
124124
${JAVA_OPTS:-$default_java_opts} \
125125
"${DEBUG-}" \
126126
"${java_args[@]}" \

0 commit comments

Comments
 (0)