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

Closed
opened 2022-06-18 05:06:42 +02:00 by D3vil0p3r · 4 comments
D3vil0p3r commented 2022-06-18 05:06:42 +02:00 (Migrated from github.com)

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.

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 2022-07-19 02:03:47 +02:00 (Migrated from github.com)

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'

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 2022-07-19 09:49:16 +02:00 (Migrated from github.com)

Thanks!

Thanks!
DeutscheGabanna commented 2023-10-26 23:12:47 +02:00 (Migrated from github.com)

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 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 2024-06-05 12:32:32 +02:00 (Migrated from github.com)

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 :)

> 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 :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seeseemelk/cool-retro-term#728
No description provided.