'press Enter in console reads like "" line

When I use readline/readln(kotlin) for input I can't read a few lines.

For example:

fun main() {
 val n1 = readln()
 val n2 = readln()
 val n3 = readln()
 val n4 = readln()
 val n5 = readln()
 println(n1 + n2 + n3 + n4 + n5)
}

Input:
1
2
3
*Input ends*

Output:
123

Debug:
n1="1"
n2=""
n3="2"
n4=""
n5="3"

Enter reads like ""

How can i repair this?

OS: Linux Fedora 36

IDEA Version: IntelliJ IDEA 2022.1.1 (Community Edition) Build #IC-221.5591.52, built on May 10, 2022 Runtime version: 11.0.14.1+1-b2043.45 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.17.6-300.fc36.x86_64 GC: G1 Young Generation, G1 Old Generation Memory: 1982M Cores: 12 Non-Bundled Plugins: com.jetbrains.edu (2022.4-2022.1-218) Kotlin: 221-1.6.21-release-337-IJ5591.52 Current Desktop: GNOME



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source