Friday, May 3, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 15136  / 3 Years ago, thu, june 3, 2021, 7:07:36

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?


More From » command-line

 Answers
3

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.


[#40754] Friday, June 4, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ligenvirt

Total Points: 238
Total Questions: 98
Total Answers: 100

Location: Senegal
Member since Fri, Aug 21, 2020
4 Years ago
ligenvirt questions
Tue, Aug 17, 21, 02:28, 3 Years ago
Thu, Sep 23, 21, 17:55, 3 Years ago
Mon, Oct 18, 21, 03:34, 3 Years ago
;