[scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

View: New views
15 Messages — Rating Filter:   Alert me  

[scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Cay Horstmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Martin Odersky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

 -- Martin

On Tue, Sep 8, 2009 at 4:18 PM, Cay Horstmann<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
>

Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Randall Schulz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Kevin Wright-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or you could explicitly disable jline when launching the repl, though I forget the argument needed to do this.

Only catch is, you then lose autocompletion...


On Tue, Sep 8, 2009 at 3:28 PM, Randall R Schulz <rschulz@...> wrote:
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


Fwd: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Cay Horstmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, but I want autocompletion. Otherwise I can just use Emacs shell mode.

Let's try that angle. Is there a way of getting autocompletion when running scala inside emacs?

Thanks,

Cay

---------- Forwarded message ----------
From: Kevin Wright <kev.lee.wright@...>
Date: Tue, Sep 8, 2009 at 7:36 AM
Subject: Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs
To: Randall R Schulz <rschulz@...>
Cc: scala-tools@...


Or you could explicitly disable jline when launching the repl, though I forget the argument needed to do this.

Only catch is, you then lose autocompletion...


On Tue, Sep 8, 2009 at 3:28 PM, Randall R Schulz <rschulz@...> wrote:
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



Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Ricky Clarkson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

M-x term RET
scala RET

Does that do it (using the awkward 'term' instead of 'shell')?  I don't
have emacs (or Scala 2.8) set up on my Windows box at the moment to
check.

2009/9/9 Cay Horstmann <cay.horstmann@...>:

> Ok, but I want autocompletion. Otherwise I can just use Emacs shell mode.
>
> Let's try that angle. Is there a way of getting autocompletion when running
> scala inside emacs?
>
> Thanks,
>
> Cay
>
> ---------- Forwarded message ----------
> From: Kevin Wright <kev.lee.wright@...>
> Date: Tue, Sep 8, 2009 at 7:36 AM
> Subject: Re: [scala-tools] Trouble with running Scala interpreter in rxvt
> and Emacs
> To: Randall R Schulz <rschulz@...>
> Cc: scala-tools@...
>
>
> Or you could explicitly disable jline when launching the repl, though I
> forget the argument needed to do this.
> Only catch is, you then lose autocompletion...
>
> On Tue, Sep 8, 2009 at 3:28 PM, Randall R Schulz <rschulz@...> wrote:
>>
>> 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
>
>
>



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky.clarkson@...

Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Cay Horstmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, using term instead of shell doesn't make any difference. Hitting TAB still just moves to the next tab stop.

On Tue, Sep 8, 2009 at 7:40 PM, Ricky Clarkson <ricky.clarkson@...> wrote:
M-x term RET
scala RET

Does that do it (using the awkward 'term' instead of 'shell')?  I don't
have emacs (or Scala 2.8) set up on my Windows box at the moment to
check.

2009/9/9 Cay Horstmann <cay.horstmann@...>:
> Ok, but I want autocompletion. Otherwise I can just use Emacs shell mode.
>
> Let's try that angle. Is there a way of getting autocompletion when running
> scala inside emacs?
>
> Thanks,
>
> Cay
>
> ---------- Forwarded message ----------
> From: Kevin Wright <kev.lee.wright@...>
> Date: Tue, Sep 8, 2009 at 7:36 AM
> Subject: Re: [scala-tools] Trouble with running Scala interpreter in rxvt
> and Emacs
> To: Randall R Schulz <rschulz@...>
> Cc: scala-tools@...
>
>
> Or you could explicitly disable jline when launching the repl, though I
> forget the argument needed to do this.
> Only catch is, you then lose autocompletion...
>
> On Tue, Sep 8, 2009 at 3:28 PM, Randall R Schulz <rschulz@...> wrote:
>>
>> 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
>
>
>



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky.clarkson@...


Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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


Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Kevin Wright-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...> 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



Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can always disable jline.  -Ynojline (or is it -Xnojline?)

On Wed, Sep 9, 2009 at 8:41 PM, Kevin Wright <kev.lee.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 <joshua.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 <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




Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...> 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@...> 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




Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by David Bernard-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...>
> 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@...>
>> 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@...>
>>> 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
>>>
>>
>
>

Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Cay Horstmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...> 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@...>
> 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@...>
>> 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@...>
>>> 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
>>>
>>
>
>


Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by Kevin Wright-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...> 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@...> 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@...>
> 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@...>
>> 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@...>
>>> 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
>>>
>>
>
>



Re: [scala-tools] Trouble with running Scala interpreter in rxvt and Emacs

by David Bernard-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
<kev.lee.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 <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
>> <david.bernard.31@...> 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@...>
>>> 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@...>
>>> > 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@...>
>>> >> 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@...>
>>> >>> 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
>>> >>>
>>> >>
>>> >
>>> >
>>
>
>