Closed D3vil0p3r closed 2 years ago
You can do this by invoking a shell as the program, and then asking it to run the commands you want:
cool-retro-term -e /bin/sh -c '<command1>; <command2>'
To prevent the terminal closing after the command(s) you can do this:
cool-retro-term -e /bin/sh -c 'neofetch; echo "Press any key to exit"; read x'
Thanks!
EDIT after some testing:
cool-retro-term -e /bin/bash
- this loads current user's bash profile correctly, even without commands like source ~/.bashrc
. I can run any program from this like I could from starting the terminal manually.
However, if you try to launch cool-retro-term like @D3vil0p3r suggests - using cool-retro-term -e /bin/bash -c 'source ~/.bashrc; echo whatever'
the profile never gets loaded. So if you try to run an application from this new window, it will most likely fail as it has no $PATH or any other environmental variables.
EDIT after some testing:
cool-retro-term -e /bin/bash
- this loads current user's bash profile correctly, even without commands likesource ~/.bashrc
. I can run any program from this like I could from starting the terminal manually.However, if you try to launch cool-retro-term like @D3vil0p3r suggests - using
cool-retro-term -e /bin/bash -c 'source ~/.bashrc; echo whatever'
the profile never gets loaded. So if you try to run an application from this new window, it will most likely fail as it has no $PATH or any other environmental variables.
I still have this problem in 2024 :)
Hello, when the user provides a command by the application, for example
cool-retro-term -e neofetch
, the terminal closes after its execution. Usually, for keeping the terminal opened, a further command calling a shell can be typed. The problem is that,-e
argument seems to not take more than one command, where the first command is parsed by cool-retro-term and the second command is executed by the terminal where I typedcool-retro-term -e <command1>; <command2>
.I also tried to wrap the two commands after
-e
argument inside double or single quotes but it is not working. Can you please implement the possibility to set more than 1 command by using-e
argument? I think this could be done onmain.cpp
file by managing better thecmdList
variable.Furthermore, if I try to setting a startup command on the GUI settings -> Advanced, I have the same issue because, if I use a command, as
neofetch
, after the execution the terminal closes. If I insert two commands asneofetch;bash
, they are not executed.