- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Trouble with running Scala interpreter in rxvt and Emacs
Tue, 2009-09-08, 15:18
Hi, I am about to use Scala in my programming languages class again, and I am boldly going with the 2.8.0 nightly. Sadly, a good number of students are using Windows. Normally, I tell them to just install Cygwin and rxvt, so that they get a decent terminal. But rxvt is messed up with Scala. It just sits there and doesn't pass any input to the interpreter. Any suggestions?
Of course, Emacs shell mode works, but how do I get autocompletion? Hitting Tab just inserts a tab. Is there some fix for that?
Thanks,
Cay
Of course, Emacs shell mode works, but how do I get autocompletion? Hitting Tab just inserts a tab. Is there some fix for that?
Thanks,
Cay
Tue, 2009-09-08, 15:47
#2
Re: Trouble with running Scala interpreter in rxvt and Emacs
On Tuesday September 8 2009, Cay Horstmann wrote:
> Hi, I am about to use Scala in my programming languages class again,
> and I am boldly going with the 2.8.0 nightly. Sadly, a good number of
> students are using Windows. Normally, I tell them to just install
> Cygwin and rxvt, so that they get a decent terminal. But rxvt is
> messed up with Scala. It just sits there and doesn't pass any input
> to the interpreter. Any suggestions?
>
> Of course, Emacs shell mode works, but how do I get autocompletion?
> Hitting Tab just inserts a tab. Is there some fix for that?
>
> Thanks,
>
> Cay
One hunch is that Cygwin's tty emulation is flawed and / or jLine
doesn't properly detect that it's connected to a tty and falls back to
a non-interactive mode.
You could try wrapping your Scala REPL invocation in a script that
explicitly puts the tty in a mode that will cater to jLine, though that
might not be possible. E.g., there may be no setting (on or off) of
echo that will produce the right behavior in all circumstances.
Some ambitious person should undertake to replace jLine with a better
terminal support library. Once upon a time, I had success wrapping the
Clojure REPL in the rlwrap, so it might be feasible. Rlwrap applies the
readline library (distinctly superior to jLine) to the program it
wraps.
But then, I don't know what is rlwrap's status on Cygwin, either.
Randall Schulz
Thu, 2009-09-10, 01:37
#3
Re: Trouble with running Scala interpreter in rxvt and Emacs
I believe this is a jline problem.
You should try the maven-scala-plugin's mvn scala:console command, as we ensured this worked on windows so I can use it at my job. There's still the unfortunate issue where you need run mvn compile first, then mvn scala:console (you cannot do both together yet), but I hope to look into that when my time is more free.
- Josh
On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
You should try the maven-scala-plugin's mvn scala:console command, as we ensured this worked on windows so I can use it at my job. There's still the unfortunate issue where you need run mvn compile first, then mvn scala:console (you cannot do both together yet), but I hope to look into that when my time is more free.
- Josh
On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
Hi, I am about to use Scala in my programming languages class again, and I am boldly going with the 2.8.0 nightly. Sadly, a good number of students are using Windows. Normally, I tell them to just install Cygwin and rxvt, so that they get a decent terminal. But rxvt is messed up with Scala. It just sits there and doesn't pass any input to the interpreter. Any suggestions?
Of course, Emacs shell mode works, but how do I get autocompletion? Hitting Tab just inserts a tab. Is there some fix for that?
Thanks,
Cay
Thu, 2009-09-10, 01:57
#4
Re: Trouble with running Scala interpreter in rxvt and Emacs
I don't think this'll work. The fix to maven-scala-plugin just allows the REPL to run in-process, just as though you had run it via the scala command.
I think the problem here is that JLine gets upset with rxvt under cygwin-X. If it doesn't work for the standard Scala command line then it's very unlikely to behave when running via maven.
On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth <joshua.suereth@gmail.com> wrote:
I think the problem here is that JLine gets upset with rxvt under cygwin-X. If it doesn't work for the standard Scala command line then it's very unlikely to behave when running via maven.
On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth <joshua.suereth@gmail.com> wrote:
I believe this is a jline problem.
You should try the maven-scala-plugin's mvn scala:console command, as we ensured this worked on windows so I can use it at my job. There's still the unfortunate issue where you need run mvn compile first, then mvn scala:console (you cannot do both together yet), but I hope to look into that when my time is more free.
- Josh
On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
Hi, I am about to use Scala in my programming languages class again, and I am boldly going with the 2.8.0 nightly. Sadly, a good number of students are using Windows. Normally, I tell them to just install Cygwin and rxvt, so that they get a decent terminal. But rxvt is messed up with Scala. It just sits there and doesn't pass any input to the interpreter. Any suggestions?
Of course, Emacs shell mode works, but how do I get autocompletion? Hitting Tab just inserts a tab. Is there some fix for that?
Thanks,
Cay
Thu, 2009-09-10, 02:37
#5
Re: Trouble with running Scala interpreter in rxvt and Emacs
You can always disable jline. -Ynojline (or is it -Xnojline?)
On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.wright@googlemail.com> wrote:
On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.wright@googlemail.com> wrote:
I don't think this'll work. The fix to maven-scala-plugin just allows the REPL to run in-process, just as though you had run it via the scala command.
I think the problem here is that JLine gets upset with rxvt under cygwin-X. If it doesn't work for the standard Scala command line then it's very unlikely to behave when running via maven.
On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth <joshua.suereth@gmail.com> wrote:
I believe this is a jline problem.
You should try the maven-scala-plugin's mvn scala:console command, as we ensured this worked on windows so I can use it at my job. There's still the unfortunate issue where you need run mvn compile first, then mvn scala:console (you cannot do both together yet), but I hope to look into that when my time is more free.
- Josh
On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
Hi, I am about to use Scala in my programming languages class again, and I am boldly going with the 2.8.0 nightly. Sadly, a good number of students are using Windows. Normally, I tell them to just install Cygwin and rxvt, so that they get a decent terminal. But rxvt is messed up with Scala. It just sits there and doesn't pass any input to the interpreter. Any suggestions?
Of course, Emacs shell mode works, but how do I get autocompletion? Hitting Tab just inserts a tab. Is there some fix for that?
Thanks,
Cay
Thu, 2009-09-10, 02:47
#6
Re: Trouble with running Scala interpreter in rxvt and Emacs
Also, why are you not using PowerShell.... ? It's the windows way....
(I tend to prefer ubuntu for development but when in Rome....)
On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.wright@googlemail.com> wrote:
(I tend to prefer ubuntu for development but when in Rome....)
On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.wright@googlemail.com> wrote:
I don't think this'll work. The fix to maven-scala-plugin just allows the REPL to run in-process, just as though you had run it via the scala command.
I think the problem here is that JLine gets upset with rxvt under cygwin-X. If it doesn't work for the standard Scala command line then it's very unlikely to behave when running via maven.
On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth <joshua.suereth@gmail.com> wrote:
I believe this is a jline problem.
You should try the maven-scala-plugin's mvn scala:console command, as we ensured this worked on windows so I can use it at my job. There's still the unfortunate issue where you need run mvn compile first, then mvn scala:console (you cannot do both together yet), but I hope to look into that when my time is more free.
- Josh
On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
Hi, I am about to use Scala in my programming languages class again, and I am boldly going with the 2.8.0 nightly. Sadly, a good number of students are using Windows. Normally, I tell them to just install Cygwin and rxvt, so that they get a decent terminal. But rxvt is messed up with Scala. It just sits there and doesn't pass any input to the interpreter. Any suggestions?
Of course, Emacs shell mode works, but how do I get autocompletion? Hitting Tab just inserts a tab. Is there some fix for that?
Thanks,
Cay
Thu, 2009-09-10, 11:37
#7
Re: Trouble with running Scala interpreter in rxvt and Emacs
When you are under REPL, you don't use feature of a "decent terminal".
So why not, simply run the interpreter from DOS ?
/davidB (KISS adept)
On Thu, Sep 10, 2009 at 03:29, Josh Suereth wrote:
> Also, why are you not using PowerShell.... ? It's the windows way....
>
> (I tend to prefer ubuntu for development but when in Rome....)
>
> On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright
> wrote:
>>
>> I don't think this'll work. The fix to maven-scala-plugin just allows the
>> REPL to run in-process, just as though you had run it via the scala command.
>> I think the problem here is that JLine gets upset with rxvt under
>> cygwin-X. If it doesn't work for the standard Scala command line then it's
>> very unlikely to behave when running via maven.
>>
>>
>>
>> On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth
>> wrote:
>>>
>>> I believe this is a jline problem.
>>>
>>> You should try the maven-scala-plugin's mvn scala:console command, as we
>>> ensured this worked on windows so I can use it at my job. There's still the
>>> unfortunate issue where you need run mvn compile first, then mvn
>>> scala:console (you cannot do both together yet), but I hope to look into
>>> that when my time is more free.
>>>
>>> - Josh
>>>
>>> On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann
>>> wrote:
>>>>
>>>> Hi, I am about to use Scala in my programming languages class again, and
>>>> I am boldly going with the 2.8.0 nightly. Sadly, a good number of students
>>>> are using Windows. Normally, I tell them to just install Cygwin and rxvt, so
>>>> that they get a decent terminal. But rxvt is messed up with Scala. It just
>>>> sits there and doesn't pass any input to the interpreter. Any suggestions?
>>>>
>>>> Of course, Emacs shell mode works, but how do I get autocompletion?
>>>> Hitting Tab just inserts a tab. Is there some fix for that?
>>>>
>>>> Thanks,
>>>>
>>>> Cay
>>>
>>
>
>
Mon, 2009-09-14, 18:37
#8
Re: Trouble with running Scala interpreter in rxvt and Emacs
Well, the "decent terminal" feature that is needed is paste. It is easy in rxvt (with Shift+Ins), and painful in Windows. (Recent versions of Windows have an optional "QuickEdit" feature that is better--you paste with the right mouse button, just like the middle mouse button in X Windows. But not all of my students have that.) Powershell doesn't do anything for this, at least on my Windows 7 system. It seems to have the same copy/paste behavior as cmd.
Running scala -Xnojline does work, but you lose tab completion.
I tried the patch in http://lampsvn.epfl.ch/trac/scala/ticket/2097, and it worked for me. That seems like something that should be added to the 2.8 release.
Now, if someone could point me to a tip for tab completion in Emacs.
Thanks,
Cay
On Thu, Sep 10, 2009 at 3:28 AM, David Bernard <david.bernard.31@gmail.com> wrote:
Running scala -Xnojline does work, but you lose tab completion.
I tried the patch in http://lampsvn.epfl.ch/trac/scala/ticket/2097, and it worked for me. That seems like something that should be added to the 2.8 release.
Now, if someone could point me to a tip for tab completion in Emacs.
Thanks,
Cay
On Thu, Sep 10, 2009 at 3:28 AM, David Bernard <david.bernard.31@gmail.com> wrote:
When you are under REPL, you don't use feature of a "decent terminal".
So why not, simply run the interpreter from DOS ?
/davidB (KISS adept)
On Thu, Sep 10, 2009 at 03:29, Josh Suereth <joshua.suereth@gmail.com> wrote:
> Also, why are you not using PowerShell.... ? It's the windows way....
>
> (I tend to prefer ubuntu for development but when in Rome....)
>
> On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.wright@googlemail.com>
> wrote:
>>
>> I don't think this'll work. The fix to maven-scala-plugin just allows the
>> REPL to run in-process, just as though you had run it via the scala command.
>> I think the problem here is that JLine gets upset with rxvt under
>> cygwin-X. If it doesn't work for the standard Scala command line then it's
>> very unlikely to behave when running via maven.
>>
>>
>>
>> On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth <joshua.suereth@gmail.com>
>> wrote:
>>>
>>> I believe this is a jline problem.
>>>
>>> You should try the maven-scala-plugin's mvn scala:console command, as we
>>> ensured this worked on windows so I can use it at my job. There's still the
>>> unfortunate issue where you need run mvn compile first, then mvn
>>> scala:console (you cannot do both together yet), but I hope to look into
>>> that when my time is more free.
>>>
>>> - Josh
>>>
>>> On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com>
>>> wrote:
>>>>
>>>> Hi, I am about to use Scala in my programming languages class again, and
>>>> I am boldly going with the 2.8.0 nightly. Sadly, a good number of students
>>>> are using Windows. Normally, I tell them to just install Cygwin and rxvt, so
>>>> that they get a decent terminal. But rxvt is messed up with Scala. It just
>>>> sits there and doesn't pass any input to the interpreter. Any suggestions?
>>>>
>>>> Of course, Emacs shell mode works, but how do I get autocompletion?
>>>> Hitting Tab just inserts a tab. Is there some fix for that?
>>>>
>>>> Thanks,
>>>>
>>>> Cay
>>>
>>
>
>
Mon, 2009-09-14, 18:47
#9
Re: Trouble with running Scala interpreter in rxvt and Emacs
As we speak, I'm working on getting JTextPane up to speed as a 1st class citizen of Scala swing. The goal is to then use this as the basis for a swing-based console which can be totally agnostic as to the behaviour of the underlying OS and won't require jline.
I let it drop slightly in priority, once I figured there was no chance of getting it in for 2.8. Plus, I'm also working on a scala-compiler plugin that's managed to suck me in as a more interesting challenge, but I digress...
If enough people feel that a swing console could be of serious benefit to them, then I'll rethink my priorities on this one. I won't ask for $40, but I'm not immune to offers of beer if anyone feels like being especially persuasive. :)
On Mon, Sep 14, 2009 at 6:35 PM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
I let it drop slightly in priority, once I figured there was no chance of getting it in for 2.8. Plus, I'm also working on a scala-compiler plugin that's managed to suck me in as a more interesting challenge, but I digress...
If enough people feel that a swing console could be of serious benefit to them, then I'll rethink my priorities on this one. I won't ask for $40, but I'm not immune to offers of beer if anyone feels like being especially persuasive. :)
On Mon, Sep 14, 2009 at 6:35 PM, Cay Horstmann <cay.horstmann@gmail.com> wrote:
Well, the "decent terminal" feature that is needed is paste. It is easy in rxvt (with Shift+Ins), and painful in Windows. (Recent versions of Windows have an optional "QuickEdit" feature that is better--you paste with the right mouse button, just like the middle mouse button in X Windows. But not all of my students have that.) Powershell doesn't do anything for this, at least on my Windows 7 system. It seems to have the same copy/paste behavior as cmd.
Running scala -Xnojline does work, but you lose tab completion.
I tried the patch in http://lampsvn.epfl.ch/trac/scala/ticket/2097, and it worked for me. That seems like something that should be added to the 2.8 release.
Now, if someone could point me to a tip for tab completion in Emacs.
Thanks,
Cay
On Thu, Sep 10, 2009 at 3:28 AM, David Bernard <david.bernard.31@gmail.com> wrote:
When you are under REPL, you don't use feature of a "decent terminal".
So why not, simply run the interpreter from DOS ?
/davidB (KISS adept)
On Thu, Sep 10, 2009 at 03:29, Josh Suereth <joshua.suereth@gmail.com> wrote:
> Also, why are you not using PowerShell.... ? It's the windows way....
>
> (I tend to prefer ubuntu for development but when in Rome....)
>
> On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.wright@googlemail.com>
> wrote:
>>
>> I don't think this'll work. The fix to maven-scala-plugin just allows the
>> REPL to run in-process, just as though you had run it via the scala command.
>> I think the problem here is that JLine gets upset with rxvt under
>> cygwin-X. If it doesn't work for the standard Scala command line then it's
>> very unlikely to behave when running via maven.
>>
>>
>>
>> On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth <joshua.suereth@gmail.com>
>> wrote:
>>>
>>> I believe this is a jline problem.
>>>
>>> You should try the maven-scala-plugin's mvn scala:console command, as we
>>> ensured this worked on windows so I can use it at my job. There's still the
>>> unfortunate issue where you need run mvn compile first, then mvn
>>> scala:console (you cannot do both together yet), but I hope to look into
>>> that when my time is more free.
>>>
>>> - Josh
>>>
>>> On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann <cay.horstmann@gmail.com>
>>> wrote:
>>>>
>>>> Hi, I am about to use Scala in my programming languages class again, and
>>>> I am boldly going with the 2.8.0 nightly. Sadly, a good number of students
>>>> are using Windows. Normally, I tell them to just install Cygwin and rxvt, so
>>>> that they get a decent terminal. But rxvt is messed up with Scala. It just
>>>> sits there and doesn't pass any input to the interpreter. Any suggestions?
>>>>
>>>> Of course, Emacs shell mode works, but how do I get autocompletion?
>>>> Hitting Tab just inserts a tab. Is there some fix for that?
>>>>
>>>> Thanks,
>>>>
>>>> Cay
>>>
>>
>
>
Thu, 2009-09-24, 16:07
#10
Re: Trouble with running Scala interpreter in rxvt and Emacs
Today I need to work under windows, and I found a better console for
MS-DOS (with decent copy/paste ;) )
Cay may be solution for your student to have a decent terminal without
needed to install msys, cygwin,...
http://sourceforge.net/projects/console/
/davidB
On Mon, Sep 14, 2009 at 19:46, Kevin Wright
wrote:
> As we speak, I'm working on getting JTextPane up to speed as a 1st class
> citizen of Scala swing. The goal is to then use this as the basis for a
> swing-based console which can be totally agnostic as to the behaviour of the
> underlying OS and won't require jline.
> I let it drop slightly in priority, once I figured there was no chance of
> getting it in for 2.8. Plus, I'm also working on a scala-compiler plugin
> that's managed to suck me in as a more interesting challenge, but I
> digress...
> If enough people feel that a swing console could be of serious benefit to
> them, then I'll rethink my priorities on this one. I won't ask for $40, but
> I'm not immune to offers of beer if anyone feels like being especially
> persuasive. :)
>
>
> On Mon, Sep 14, 2009 at 6:35 PM, Cay Horstmann
> wrote:
>>
>> Well, the "decent terminal" feature that is needed is paste. It is easy in
>> rxvt (with Shift+Ins), and painful in Windows. (Recent versions of Windows
>> have an optional "QuickEdit" feature that is better--you paste with the
>> right mouse button, just like the middle mouse button in X Windows. But not
>> all of my students have that.) Powershell doesn't do anything for this, at
>> least on my Windows 7 system. It seems to have the same copy/paste behavior
>> as cmd.
>>
>> Running scala -Xnojline does work, but you lose tab completion.
>>
>> I tried the patch in http://lampsvn.epfl.ch/trac/scala/ticket/2097, and it
>> worked for me. That seems like something that should be added to the 2.8
>> release.
>>
>> Now, if someone could point me to a tip for tab completion in Emacs.
>>
>> Thanks,
>>
>> Cay
>>
>> On Thu, Sep 10, 2009 at 3:28 AM, David Bernard
>> wrote:
>>>
>>> When you are under REPL, you don't use feature of a "decent terminal".
>>> So why not, simply run the interpreter from DOS ?
>>>
>>> /davidB (KISS adept)
>>>
>>> On Thu, Sep 10, 2009 at 03:29, Josh Suereth
>>> wrote:
>>> > Also, why are you not using PowerShell.... ? It's the windows way....
>>> >
>>> > (I tend to prefer ubuntu for development but when in Rome....)
>>> >
>>> > On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright
>>> >
>>> > wrote:
>>> >>
>>> >> I don't think this'll work. The fix to maven-scala-plugin just allows
>>> >> the
>>> >> REPL to run in-process, just as though you had run it via the scala
>>> >> command.
>>> >> I think the problem here is that JLine gets upset with rxvt under
>>> >> cygwin-X. If it doesn't work for the standard Scala command line then
>>> >> it's
>>> >> very unlikely to behave when running via maven.
>>> >>
>>> >>
>>> >>
>>> >> On Thu, Sep 10, 2009 at 1:35 AM, Josh Suereth
>>> >>
>>> >> wrote:
>>> >>>
>>> >>> I believe this is a jline problem.
>>> >>>
>>> >>> You should try the maven-scala-plugin's mvn scala:console command, as
>>> >>> we
>>> >>> ensured this worked on windows so I can use it at my job. There's
>>> >>> still the
>>> >>> unfortunate issue where you need run mvn compile first, then mvn
>>> >>> scala:console (you cannot do both together yet), but I hope to look
>>> >>> into
>>> >>> that when my time is more free.
>>> >>>
>>> >>> - Josh
>>> >>>
>>> >>> On Tue, Sep 8, 2009 at 10:18 AM, Cay Horstmann
>>> >>>
>>> >>> wrote:
>>> >>>>
>>> >>>> Hi, I am about to use Scala in my programming languages class again,
>>> >>>> and
>>> >>>> I am boldly going with the 2.8.0 nightly. Sadly, a good number of
>>> >>>> students
>>> >>>> are using Windows. Normally, I tell them to just install Cygwin and
>>> >>>> rxvt, so
>>> >>>> that they get a decent terminal. But rxvt is messed up with Scala.
>>> >>>> It just
>>> >>>> sits there and doesn't pass any input to the interpreter. Any
>>> >>>> suggestions?
>>> >>>>
>>> >>>> Of course, Emacs shell mode works, but how do I get autocompletion?
>>> >>>> Hitting Tab just inserts a tab. Is there some fix for that?
>>> >>>>
>>> >>>> Thanks,
>>> >>>>
>>> >>>> Cay
>>> >>>
>>> >>
>>> >
>>> >
>>
>
>
Hi Cay,
At the moment I would really recommend to go with 2.7.5. Trunk is
pretty unstable right now and will remain it for the next 3-4 weeks.
At the end of that period, we hope to have the firts 2.8 beta, and
that should be usable in class.
Cheers