Swordfish90 / cool-retro-term

A good looking terminal emulator which mimics the old cathode display...
22.22k stars 846 forks source link

cool-retro-term - no multiple commands by -e arguments and terminal closing #728

Closed D3vil0p3r closed 2 years ago

D3vil0p3r commented 2 years ago

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 typed cool-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 on main.cpp file by managing better the cmdList 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 as neofetch;bash, they are not executed.

ali1234 commented 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'

D3vil0p3r commented 2 years ago

Thanks!

DeutscheGabanna commented 11 months ago

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.

DeutscheGabanna commented 4 months ago

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.

I still have this problem in 2024 :)