Kotlin / kotlin-interactive-shell

Kotlin Language Interactive Shell
Apache License 2.0
587 stars 36 forks source link

Is LF a terminator for readln ? #117

Closed LaurentBerger closed 8 months ago

LaurentBerger commented 2 years ago

Hi,

version windows 64 ki-shell 0.5.2/1.7.0

in ki-shell I tried var x:String?=readln() Using keyboard I type 123456 and enter. Nothing happens. Then I pressed Ctrl+z and enter again . I have got my data in x. In readln doc 1 it is written

LF or CRLF is treated as the line terminator. Line terminator is not included in the returned string.

Why do i need ctrl+z?

x.length is 7 with

x?.get(6) 
Char =

See also https://youtrack.jetbrains.com/issue/KT-53099