Leaving qterminal open after calling and executing a program (-e option)

(Hmollercl) #1

Hi, I posted this as an issue in qterminal, but since I have no response I will reply it here. currently when you call qterminal to execute a command (qterminal -e) it close and you cannot see the output of the command. Is there some way to leave it open?

(Ringo32) #2

make some script to make it work ?

and in that script would be like ‘read’ when pushit closes?

(Hmollercl) #3

any idea and hot to that that script? currently I’m using it with python like this:

cmd = ['qterminal', '-e', 'sudo', 'apt', 'dist-upgrade']
process = subprocess.Popen(cmd)

which is like callingit from terminal: $qterminal -e sudo apt dist-upgrade

it works ok, it even interacts, but when it finished qterminal closes so I don’t know if it ended well or not. Even if qterminal is configured to ask before closes, it ask but with no tab open.

(Ringo32) #4

really i am bad in scripting…

what i do with updates in my shortkeys :

script 1

  #!/usr/bin/env bash
n=$(checkupdates | wc -l)
if [ "$n" != "0" ]; then
    notify-send "System update" "$n updates available." -i /usr/share/antergos/antergos-menu.png
    lxqt-sudo qterminal -e 'pacupd2'

script 2

#!/usr/bin/env bash pacman -Syu echo ‘gedaan, druk enter’ read

i call script 1 with shortkey with that lxqt-sudo qterminal calls pacupd2 …

further i am a noob in scripting this just work for me :slightly_smiling_face: