Rookie here :wave: `readln` fails in IDE but works...
# kotlin-native
t
Rookie here 👋
readln
fails in IDE but works in terminal. Any idea how I can fix this? 🤔
e
IDE uses Gradle runner and getting input from within Gradle is pretty challenging. you may be able to modify the run task as per https://github.com/gradle/gradle/issues/1251#issuecomment-459369978 but in general I wouldn't bother, it's too flaky. just run the binary from the terminal
🙏 1
🤝 1
t
@ephemient Thanks. Adding below line to gradle fixed the issue
Copy code
tasks.named<Exec>("runDebugExecutableNative") {
    standardInput = System.`in`
}