How to access TTY/PTY from within IntelliJ IDEA

I am writing a package that is supposed to take input via signals and pipes in Kotlin/Multiplatform.
Currently I have a main() function in Jvm, but how can I execute it inside IDEA and receive input via keyboard. I have implemented the necessary JNI and other signaling functions, just need to get proper keyboard interaction via a shell.

I am using green arrow besides the main() function
Skärmavbild 2022-04-01 kl. 00.38.06

After a bunch of testing, adding isatty(fd) inside my JNI C code I got the answer the Java REPL is not a TTY from within POSIX / microkernel.

So my new question is how do I access a TTY/PTY from within IntelliJ?