Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tend to frequently open a text file from the terminal with a command like so:

gedit filename.txt

However, the behaviour is inconsistent; sometimes, the focus will leave the terminal and will not return until I have closed the file. Other times, the terminal will maintain a prompt, as if I had run:

gedit filename.txt &

Why this discrepancy?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

It usually depends on whether gedit is already running.

  • If it is, the open jibbery gets sent to the open process and depending on how things are running (Gedit 3.x seems to have some weird behaviours) it'll fork into a new window or just a new tab.

  • If it's not, a new process is started as a child of the prompt, so it blocks the prompt.

If it really annoys you, you can create an alias, or a ~/bin/ script to override the standard behaviour and force it to fork out with & every time.

share|improve this answer
    
Good work, thanks. I hadn't noticed that sometimes I had/didn't have gedit running. –  Bill Cheatham Jan 26 '12 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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