Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I want to create application which launches some terminal, then some command is executed on that terminal and then prevent terminal from closing. I started to do on gnome-terminal ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12

    prevent terminal from closing after command execution.


    Hello,

    I want to create application which launches some terminal, then some command is executed on that terminal and then prevent terminal from closing.

    I started to do on gnome-terminal because the Gnome is the most widely used desktop-manager in the Linux distributions.

    I want to do something like that:
    gnome-terminal --sync -x tcsh -c "cd xys; command ;" &

    In konsole there is a --noclose option preventing the terminal from closing after the command execution.

    I can do it like that:
    gnome-terminal --sync -x tcsh -c "cd xys; command xxx ; exec tcsh; " &
    But then I lose the certain settings which I loaded in the terminal during the command xxx execution.

    Do you know how to prevent gnome-terminal from closing after the command execution?

  2. #2
    Just Joined!
    Join Date
    Jun 2012
    Posts
    60
    just make a statement after your programs code like "print("Press<Enter>")

  3. #3
    Just Joined!
    Join Date
    Oct 2007
    Posts
    13
    If your command is a shell script, you could put a "read discardReply;" statement at the end of the commands which would cause that window to remain active waiting for the input from the user.

  4. #4
    Just Joined!
    Join Date
    Jun 2012
    Posts
    60
    which is exactly what i said.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •