Leave xterm open after task is complete
The problem is that there is no shell running in the xterm for it to go back to when the tests are done.
Try this.
xterm -e "echo hi;bash"
Or
xterm -e "echo hi;read"
From xterm(1):
-hold Turn on the hold resource, i.e., xterm will not immediately
destroy its window when the shell command completes. It will
wait until you use the window manager to destroy/kill the win‐
dow, or if you use the menu entries that send a signal, e.g.,
HUP or KILL.
Standard command: xterm -hold "echo I'm a boy"
Gambas Code: exec["xterm", "-hold", "-e", "ps aux"
In the case were you would normally open a terminal and then source an environment script and then continue with other commands, I found the following to work where an lxterminal is all that is available.
lxterminal -e bash -c "< path to env script \> bash --noprofile"
For instance:
lxterminal -e bash -c "/home/pi/linuxcnc-dev/scripts/rip-environment bash --noprofile"
This creates a terminal window executing bash that sources an environment script to run bash that does not overwrite the sourced environment. In the end, it's leaving the terminal open with the sourced environment, which answers the question. If you remove the first -e bash
, the lxterminal hangs with no prompt.