Using OS.Execute with CMD and obtaining every new line

Godot Version

4.2.1

Question

I’m creating a new thread and calling a method that starts a CMD from which I would like to get every input, instead of waiting for the application to close and obtain it after that. So after every new line I would like to use Debug.WriteLine() to print out the entered text in the CMD. Is it possible?