Problem with typing square brackets

821 views
Skip to first unread message

Kolja Richter

unread,
Jan 16, 2015, 9:29:24 AM1/16/15
to scala...@googlegroups.com
Hello everyone, 

I am a Newbie, trying to learn how to code with scala. Currently, I using the introductory book "Programming in Scala" by Martin Odersky. 

I have a problem, typing square brackets in the REPL. I use a Thinkpad Laptop with German keyboard layout. Normally, square brackets are produced by typing AltGr+8 and AltGr+9. (AltGr is the Alt key in the right side.) Normally, this works without difficulties, but not in the REPL. 

What happens is this: 
When I press AltGr+8 for the first time, nothing happens. When I press it for the second time, I get the opening square bracket "[". At the beginning, I just thought I had missed a key, but I really have to press 8 twice. 
When I press AltGr+9 nothing happens. I tried, pressing it twice, but it doesn't work. By complete chance I found out, how to produce the closing square bracket "]". I have to press AltGr+8, keep AltGr pressed and then press 9! This reliably produces the closing square bracket "]". 

As you can probably imagine, this is quite annoying. 

It only happens in the REPL, not in other applications, e.g. editors, wordprocessors etc. 

Since Scala relies on the JVM, I believe, that the problem might have something to do with the JVM. Out of interest, I downloaded Clojure, which is also based on the JVM and features an REPL. Et voila, the same problem in Clojure. 

OK, this problem is obviously not about programming. But if any of you has any ideas, what I could do in order to have normal keyboard response in the REPL, I would be glad to hear (read) them. 

Thanks in advance 

Kolja

Oliver Ruebenacker

unread,
Jan 16, 2015, 9:55:28 AM1/16/15
to Kolja Richter, scala-user

     Hello,

  When you say this does not happen in other applications, did you also check applications running in the same terminal window as the REPL?

     Best, Oliver

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Oliver Ruebenacker
Solutions Architect at Altisource Labs
Be always grateful, but never satisfied.

Oliver Ruebenacker

unread,
Jan 16, 2015, 9:57:14 AM1/16/15
to Kolja Richter, scala-user

     Hello,

  Actually, which OS and which kind of terminal do you use?

     Best, Oliver

Simon Schäfer

unread,
Jan 16, 2015, 10:19:29 AM1/16/15
to scala...@googlegroups.com

Kolja Richter

unread,
Jan 16, 2015, 11:30:59 AM1/16/15
to scala...@googlegroups.com
Hello, Oliver nice to have some reactions. My machine is a Lenovo Thinkpad Edge E555 running with Windows 7. I use Java 8. The keyboard layout is German. I also have a desktop PC running with Linux Mint, but on this machine everything works just fine.

Hello Simon, thanks for your link, which looks promising.

Kolja Richter

unread,
Jan 16, 2015, 12:09:53 PM1/16/15
to scala...@googlegroups.com
I replaced jline-2.12.jar in scala/lib with  jlin-2.11. Now everything  works as it should.

Hope  other people  like me will read this. The bug  is  quite annoying, since square brackets are often needed.

Thanks for your help.

Kolja

Som Snytt

unread,
Jan 16, 2015, 12:34:39 PM1/16/15
to scala-user
Is it safe to say that this is not a problem with the Swiss keyboard?

Or is the dotty repl using jline-2.11?

Since this has come up a few times, it will be interesting to see if a fix is induced upstream. It would probably have to be a contribution.

--

Kolja Richter

unread,
Jan 18, 2015, 5:03:39 AM1/18/15
to scala...@googlegroups.com
Hello som-snyt,

I wouldn't know whether the same issue arises with a Swiss keyboard layout, since I am located in Germany.

Greetings

Kolja

Bjorn Regnell

unread,
Jan 18, 2015, 1:46:16 PM1/18/15
to scala...@googlegroups.com
I have been hit by this bug many times when trying to help people getting started with Scala. This bug gives a bad impression to newcomers as it seems so basic and plausible to be able to type a simple type annotation... I would really like the next Scala release to go back to jline 2.11 and the problem would be solved...
/B

Grzegorz Kossakowski

unread,
Jan 21, 2015, 3:18:56 PM1/21/15
to Bjorn Regnell, scala...@googlegroups.com
For people following this thread, we are getting closer to fix for this annoying bug:


Do not hesitate to express your excitement of Michael's patch on the pull request. Hopefully, in return of a bit of positive vibe we'll get a faster release of Jline.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Grzegorz Kossakowski
Scalac hacker at Typesafe
twitter: @gkossakowski
Reply all
Reply to author
Forward
0 new messages