-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repl 3.6.4-RC1, 3.6.3, 2.13.15, 2.13.16 gives error when exit with Ctrl+D or :quit #22427
Comments
Scala 2.13.14 was when we upgraded JLine from 3.24 to 3.25 (scala/scala#10717); Scala 2.13.16 has JLine 3.27.1 but it's puzzling that that doesn't seem to line up with what you're seeing on the Scala 3 side. 3.6.2 had JLine 3.27.0, 3.6.3 has JLine 3.27.1 are there other Linux users watching the repo who could report if they see this on the same set of versions? it's possible this is somehow dependent on some detail of how Björn's terminal is configured I'm also curious if it only happens when the REPL is launched by Scala-CLI, or whether it also happens using the old runner (in either 2 or 3) I don't see anything relevant at https://github.com/jline/jline3 |
I have tried this on fresh installed Ubuntu 24 in WSL with Java 17, got no error both with Ctrl-D and
|
I don't have any special settings in my terminal but it seems specific to Ubuntu 22.04, as I don't get it on 18.04 or 20.04. And I don't get the warning that JAVA_HOME is not set that @OndrejSpanel got. |
Anyone with Ubuntu 22.04 that gets the same error when quitting the 3.6.3 repl?
@SethTisue Maybe I was switching machines and confusing version. I'll verify again when I get to my 22.04 machine (currently out of office). |
@bjornregnell thanks. it would be good to have additional confirmation, since I really would expect it to stem from the JLine version |
I cannot reproduce on 3.6.3 or 2.13.16. Ubuntu 24.04 using zsh on Kitty terminal emulator. Also cannot reproduce using bash on Gnome Terminal emulator. |
For what it's worth, the following may not be related, although it shares an I've been meaning to file a bug on what appears to be a related issue, caused by calling Here's a script that produces a similar error message: #!/opt/scala3-3.6.3-x86_64-pc-win32/bin/scala
import scala.collection.Iterator
val lines = for {
line <- Iterator.continually(scala.io.StdIn.readLine()).takeWhile( _ != null )
if line != null
} yield line
printf("%d lines\n", lines.size) Here's how to demonstrate the error message: philwalk@d5 MINGW64 /opt/ue
# ls -l | jsrc/readStdin.sc
stty: 'standard input': Inappropriate ioctl for device
Compiling project (Scala 3.6.3, JVM (17))
Compiled project (Scala 3.6.3, JVM (17))
837 lines A fix is to add a tty check to #!/usr/bin/env bash
if [ -e /usr/bin/tty -a "`tty`" != "not a tty" -a ! -p /dev/stdin ]; then
isterminal=1
# save terminal settings
saved_stty=$(stty -g 2>/dev/null)
# clear on error so we don't later try to restore them
if [[ ! $? ]]; then
saved_stty=""
fi
else
isterminal=0
fi I believe this is a long-standing scala3 bug. |
I have three different machines with Ubuntu 22.04 on which it surfaces (but all my 18.04 and 20.04 machines give no error (I have too many machines...)). I'm using the standard terminal and the terminal is not tweaked with any special setting. You can see all version of Scala 3 and 2 that I tried and it works again back in |
I confirm the issue on a freshly installed Ubuntu 22 on VMWare Workstation virtual machine (Windows 11 x64 host):
The issue is not seen with 3.6.2 - but this version shows a warning about terminal provider jna to me:
|
Scala 3 jlineI can confirm this:
Scala 2.13 jlineAs for 2.13 versions, I see the issue with all of 2.13.14-16
What is see in the classpath of Scala 2.13 versions in CLI is:
|
Note the class path is quite different for Scala 2 / Scala 3. In Scala 3 there are jni / jna listed, which are not present in the 2.13 classpath:
|
More accurate class-path dump using 3.6.3:
3,6,2:
Note 2.13 classpath contains just a single jline entry: 2.13.16:
The value changes for different 2.13 versions:
|
Compiler version
Scala 3.6.3, 2.13.15, 2.13.16 under Ubuntu 22.04
Minimized code
Output
Expectation
No error.
The text was updated successfully, but these errors were encountered: