N
N
nekosora2018-07-12 12:05:24
linux
nekosora, 2018-07-12 12:05:24

How to make a program that runs in its terminal "window"?

How can I write a C program for Linux so that it runs in a terminal in its own screen space (like nano, vi, man) and closes when it finishes and returns to the initial state of the terminal?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2018-07-12
@BuriK666

just runxterm yourprogram

K
Kirill Gerasenkov, 2018-07-14
@m000dy

well, if I understand your question correctly, then run your program as a child process through system ()

#include <stdio.h> 

int main(int argc, char *argv[] )
{
  int i = 0;
  printf("I am the child\n");
  while (--argc)
    printf ("Arg %d %s\n", ++i, *++argv);
  return 0;
}

default example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question