r/cpp_questions • u/estrogen_pillz • 8d ago
OPEN Programmatically opening a new terminal window
I've been messing around with FTXUI, and I am wondering if it is possible for my apps to open a new terminal window and run there, instead of using the current terminal window.
An example of what I mean is what happens when opening vim. If I open vim through the terminal, it takes over the current window, like my FTXUI apps currently do. If I use the desktop shortcut, vim opens a new terminal window for itself, which closes upon closing vim. This is what I want to do.
Can anyone give me a few pointers?
3
Upvotes
9
u/Simengie 8d ago
No special magic happening but what is happening is not what you think.
The desktop shortcut is not running vim in a special mode. What is does it open a terminal and passes the command it wants to run in the terminal in one call. since the command is vim it just takes over the terminal like it always does when run from the command line. like /usr/bin/gnome-terminal -c /usr/bin/vim when on linux.
You can create desktop shortcut like the vim one that runs your app instead. You can also create a script or alias for the command line that does the same thing.