Quantcast
Viewing all articles
Browse latest Browse all 5273

Beginners • Re: lxterminal commands

The "Done" message means that the background process has finished (you closed the terminal window). This message is delayed until you enter something on the terminal.
Thanks for your help. I understand that lxterminal will bring up an active terminal wither it runs with "&" or not.

And I'm not sure what "[1]+" is telling me in this case.
Try thagrol's "sleep" examples to see what is happening.

The "jobs" command lists all commands that are running in the background. When you put a job in the background with "&", it is given a local PID starting with 1, then 2 etc. That PID is what you see in the "[1]" message.

The "[PID] Done command" message appears when a background command finishes - but it doesn't appear immediately, so it doesn't get jumbled up in other output. Instead it waits until next time the command prompt is displayed.

You can use the background PID to stop the command using kill %PID (note the % in front of the PID number), like kill %1 for example.

You can bring a background command to the foreground with "fg PID".
You can put a foreground command into the background by first halting it with Ctrl-Z which will give you a "[PID]+ Stopped command" message, then use "bg PID" eg "bg 1" and the command will continue in the background.
But I am essentially asking why "lxterminal" sometimes shows up with the message "Done" and sometimes not. I have not closed the terminal window. Is it because entering the command "lxterminal" in this case ends the previous terminal that I opened with "&" (even though the terminal window does not close)?
It looks like you only need one lxterminal command running at a time. When you run a second lxterminal command it just tells the already running lxterminal to open a new window, then exits.
The thing I don't understand is why the lxterminal you ran first, in the background, terminates and the new foreground one takes over control of the windows. When I try that the first background one keeps running and the second foreground command ends.
[edit]
I think I've worked out part of that. MY default terminal is xfce4-terminal, not lxterminal. So when I ran lxterminal it was the first one to run and persisted.

Statistics: Posted by rpdom — Mon Mar 11, 2024 3:24 pm



Viewing all articles
Browse latest Browse all 5273

Trending Articles