The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Closing terminal without ending process?

    Discussion in 'Linux Compatibility and Software' started by pixelot, Jul 8, 2009.

  1. pixelot

    pixelot Notebook Acolyte

    Reputations:
    3,732
    Messages:
    6,833
    Likes Received:
    0
    Trophy Points:
    205
    This may be a really ridiculous question, but I don't seem to know the terminology for what I'm trying to find out, because a few minutes of searching and I'm no nearer truth. Oh, and it'll be quicker and more productive to ask here. :cool:

    My question is, after running a command in the terminal window, can I (and if so, how do I) exit said terminal if it is still running (has not returned to ~: prompt)? :confused:

    I have this happen if compiz crashes and then I run it in the terminal; it doesn't go straight back to the prompt, even though the windows manager restarts and I can work. But I can't close the terminal window without re-crashing it, and then it seems to restart automatically and then works. Do I make myself clear? Probably not. It's late, even on PDT, and I'm on EST now. :p

    TIA,
    -pixelot
     
  2. ALLurGroceries

    ALLurGroceries  Vegan Vermin Super Moderator

    Reputations:
    15,730
    Messages:
    7,146
    Likes Received:
    2,343
    Trophy Points:
    331
    You should run compiz & and then close the window. & will send it to the background instead of letting it hog the console.
     
  3. archer7

    archer7 Notebook Evangelist

    Reputations:
    289
    Messages:
    647
    Likes Received:
    0
    Trophy Points:
    30
    The ampersand will send it to the background, but I'm pretty sure the process will still die if its parent (terminal) is killed. The best thing I can think of is using grun, which is essentially a command launcher that forks everything over to whichever terminal X spawned from. Your process should be pretty safe there.
     
  4. helikaon

    helikaon Notebook Consultant

    Reputations:
    269
    Messages:
    288
    Likes Received:
    0
    Trophy Points:
    30
    Hi there,
    as archer said, ampersand ("&") sends the command to background, so you're still able to use the same terminal (e.g. for commands or scripts, that take longer to execute).
    But your friend is 'nohup' command.
    e.g.
    /usr/bin/nohup command &

    I use this a lot when ssh to remote machines, run some shell script, but wanna logout of there (because script takes like whole night to finish and i need to shutdown my laptop)
     
  5. ALLurGroceries

    ALLurGroceries  Vegan Vermin Super Moderator

    Reputations:
    15,730
    Messages:
    7,146
    Likes Received:
    2,343
    Trophy Points:
    331
    compiz & and closing gnome-terminal works for me on Debian Sid.

    One other alternative - Alt+F2 or whatever you have as your Run type dialog in your desktop environment. Just run compiz --replace there instead of in the terminal. As long as it's a non-interactive command it should be fine.
     
  6. pixelot

    pixelot Notebook Acolyte

    Reputations:
    3,732
    Messages:
    6,833
    Likes Received:
    0
    Trophy Points:
    205
    Thanks so much, everyone. Great responses! :)

    I should've remembered compiz &, but I didn't know the other stuff. ;)
     
  7. Pitabred

    Pitabred Linux geek con rat flail!

    Reputations:
    3,300
    Messages:
    7,115
    Likes Received:
    3
    Trophy Points:
    206
    Depending on how the script does output, I've found I use the screen utility for things like that. I actually use screen to run rtorrent in a terminal all the time on my home server, so I can reconnect to it and see how things are running and seeding and such any time.
     
  8. helikaon

    helikaon Notebook Consultant

    Reputations:
    269
    Messages:
    288
    Likes Received:
    0
    Trophy Points:
    30
    Yes, if its possible, i run vncserver on machines, if possible and then ssh tunnel to it. But sometimes link is too slow (even for lowest details) so terminal is only friend then :.)