5

I have a gnome-terminal profile created with "When the command exists: Hold the terminal open" set. How can I avoid the yellow message at the top of the gnome-terminal window that states "The child process exited normally with status 0."?

Below are the contents of the desktop entry I have pinned to the Unity launcher. File name: twitterText.desktop

[Desktop Entry]
Type=Application
Terminal=false
Icon=vinagre
Name=Text Twitter Timeline
Exec=/usr/bin/gnome-terminal --window-with-profile=Microblog --hide-menubar --command="/usr/bin/python /home/htplainf/twitterTimeline.py"

enter image description here

2 Answers 2

1

Basically, don't let the program you are running terminate! That yellow line indicates that the command you called within gnome-terminal finished sucessfully. You can even hit "relaunch" to start the program (in this case, your command line twitter) again.

I would do the following: Since you are most likely interested in a continuous update of the twitter messages, run your program within the watch command. This way, you can even define the interval "twitterTimeline.py" is run again!

Change your twitterText.desktop into the following:

[Desktop Entry]
Type=Application
Terminal=false
Icon=vinagre
Name=Text Twitter Timeline
Exec=/usr/bin/gnome-terminal --window-with-profile=Microblog --hide-menubar --command="watch -t -n 60 '/usr/bin/python /home/htplainf/twitterTimeline.py'"

Have a look at the Exec command in the last line:

watch -t -n 60 '/usr/bin/python /home/htplainf/twitterTimeline.py'

-n 60 means that your python script is executed every 60 seconds. You can easily set a different interval. Also, have a look at man watch to discover its compete functionality!

By using watch, your command never stops, so you will not see the yellow message bar on top of gnome-terminal. And your tweets are updated!

2
  • Thanks for the idea. I added raw_input() to the end of my Python script and removed "Hold the terminal open" from the gnome-terminal profile. This works perfect for my use case. I don't want to refresh the content as I have a twitter feed displayed by conky. I only open this terminal twitter feed when I've spotted something interesting with a link. I can click on the link from here. When I'm done, I press Enter and the terminal goes away. Perfect!
    – PLA
    Aug 22, 2012 at 0:32
  • I agree :-) That also prevents the process from stopping and closes the terminal. Nice!
    – ceage
    Aug 22, 2012 at 19:27
0

Your terminal setting may have,

Edit > Profile Preferences > Title and Command > When command exits: Hold the terminal open

set,

When command exits:Exit the terminal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.