summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-12 19:13:10 +0000
committerPaul Phillips <paulp@improving.org>2010-12-12 19:13:10 +0000
commit5d6b870ea8b7b62670d616b055b85b03f061ba2b (patch)
treee419b0033657dfa3a49ce3513458a04f32c59816 /src/compiler/scala/tools/ant/templates/tool-unix.tmpl
parent9c238c6accf43f2bfe9bcfcdc7aa2384e71dc165 (diff)
downloadscala-5d6b870ea8b7b62670d616b055b85b03f061ba2b.tar.gz
scala-5d6b870ea8b7b62670d616b055b85b03f061ba2b.tar.bz2
scala-5d6b870ea8b7b62670d616b055b85b03f061ba2b.zip
New jline: BSD licensed, based on [ https://git...
New jline: BSD licensed, based on [ https://github.com/jdillon/jline2 ] with additional code thanks to [ https://github.com/huynhjl/jline2 ]. Replaces lib/jline.jar with build of these sources, and modifies trunk code to work with the new jar. Hopeful improvements including baseline functionality on cygwin and 64bit windows, as well as more accurate line wrapping / cursor positioning on all platforms and ctrl-R history search. For the time being the canonical source repository is this: https://github.com/paulp/jline2 The enclosed sources are a mirror of that repository, and should be treated as read-only in the scala svn repository. No review, codewise, but people are very strongly encouraged to try it out and report any regressions.
Diffstat (limited to 'src/compiler/scala/tools/ant/templates/tool-unix.tmpl')
-rw-r--r--src/compiler/scala/tools/ant/templates/tool-unix.tmpl23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index 2a42892739..0891ef8316 100644
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -50,6 +50,10 @@ if [ -z "$TOOL_CLASSPATH" ] ; then
done
fi
+EXEC=exec
+CYGWIN_TERM_PRE=
+CYGWIN_TERM_POST=
+CYGWIN_JLINE_TERMINAL=
if $cygwin; then
if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
format=mixed
@@ -58,9 +62,19 @@ if $cygwin; then
fi
SCALA_HOME=`cygpath --$format "$SCALA_HOME"`
TOOL_CLASSPATH=`cygpath --path --$format "$TOOL_CLASSPATH"`
+ case "$TERM" in
+ rxvt* | xterm*)
+ EXEC=
+ CYGWIN_TERM_PRE="stty -icanon min 1 -echo"
+ CYGWIN_TERM_POST="stty icanon echo"
+ CYGWIN_JLINE_TERMINAL="-Djline.terminal=jline.UnixTerminal"
+ trap "$CYGWIN_TERM_POST" SIGINT
+ ;;
+ esac
+else
+ trap "stty echo" SIGINT
fi
-# Reminder: substitution ${JAVA_OPTS:=-Xmx256M -Xms16M} DO NOT work on Solaris
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="@javaflags@"
# break out -D and -J options and add them to JAVA_OPTS as well
@@ -97,11 +111,16 @@ if [ -z "$JAVACMD" -a -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
JAVACMD="$JAVA_HOME/bin/java"
fi
-exec "${JAVACMD:=java}" \
+eval $CYGWIN_TERM_PRE
+
+$EXEC "${JAVACMD:=java}" \
$JAVA_OPTS \
"${java_args[@@]}" \
$CPSWITCH \
-Dscala.usejavacp=true \
-Dscala.home="$SCALA_HOME" \
-Denv.emacs="$EMACS" \
+ $CYGWIN_JLINE_TERMINAL \
@properties@ @class@ @toolflags@ "$@@"
+
+eval $CYGWIN_TERM_POST