Running a thread in Run Configuration and showing output in console
Hi guys,
I a trying to implement run configuration, but the problem is, that I have my own java library with run API, so I want to just start the process from code in new thread and attach System.out to show in the console.
I dont have a java.lang.Process or a comand to give to the ProcessHandler in CommandLineState#startProcess() . I was trying to implement my own ProcessHandler and in getProcessInput() method just return System.out, but it is writing the output to development Idea instance and not the one with my plugin running.
How should I accomplish it? Is there some plugin, where it is done this way? Not running a process from OS command line, but from code.
Thanks for any help!
请先登录再写评论。
Hi, thank you for help.
Finally I used java piped streams to get output from System.out. I am reading it in another thread which is also writing the output to the console via consoleView#print() method. It is not the best solution, but it works for now. Too bad one can not just set console to show, what is being written in Outputstream of the process.
Hi,
Would something like this be of help to you? https://github.com/go-lang-plugin-org/go-lang-idea-plugin/blob/master/src/ro/redeul/google/go/ide/actions/GoDebugEnv.java
Cheers
Hello, your post helps a lot, thank you very much.
I'm curious about when you using pipe stream to get output from System.out, would it output not only the thread you created, but also the other thread from the process which your thread stays in?