0

I want to open a terminal with an instruction in the code.

For example, I want to manage input and output in two different terminal. One for typing instruction and one for the output of this instructions. Is it possible?

Termininja
  • 6,620
  • 12
  • 48
  • 49
Adl
  • 127
  • 3
  • 13
  • 1
    Possible duplicate of [Opening a new terminal window in C](http://stackoverflow.com/questions/19472398/opening-a-new-terminal-window-in-c) – DeiDei Jan 12 '17 at 13:27
  • You don't need C for that. The PIPEs and file descriptors what you need. – 0andriy Jan 12 '17 at 13:31
  • Sorry , i want to open a NEW terminal different from the one i have used for launching the program. something like system("gnome-terminal") is possibile? and if yes , how to redirect the output to this new terminal? – Adl Jan 12 '17 at 13:38
  • Update 2 : I notice that open a new terminal from c program is simply, but how to use this ? I want to redirect the ouput of my program to this new terminal how to do this ? – Adl Jan 12 '17 at 13:44
  • Since you mentioned gnome-terminal, do you want the output of your program to appear in a window? Do you even need a full-blown terminal? – Ian Abbott Jan 12 '17 at 14:02
  • It appears you are describing 1) beginning a new process, 2) passing to it a command, 3) retrieving a response, and 4) closing the process. So, What have you tried so far? Can you post your attempt in code? BTW, a routine built around `FILE *pipe = popen(command, "rt")` would accomplish all of this, with the exception of a visible terminal popping up. – ryyker Jan 12 '17 at 14:10

0 Answers0