M
M
Maxim Tyulpakov2020-12-28 09:47:10
linux
Maxim Tyulpakov, 2020-12-28 09:47:10

How to call a terminal emulator (bash) through a C program?

execlp("TerminalEmulator", "TerminalEmulator", argv[2], NULL);
- It doesn't work like that...

exo-open --launch TerminalEmulator- and this way you can call the terminal via the command line. But I need to call it from a C program!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2020-12-28
@CityCat4

It can be clumsy - through system (), while the parent process is suspended for the duration of the child.
You can more or less correctly - through fork () and exec (), then catch the return code through waitpid ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question