From 5d6b870ea8b7b62670d616b055b85b03f061ba2b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 12 Dec 2010 19:13:10 +0000 Subject: 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. --- .../scala/tools/ant/templates/tool-unix.tmpl | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/ant/templates/tool-unix.tmpl') 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 -- cgit v1.2.3