This option will be used with one or more filenames to open and it should cover 3 aspects:
1. When there is no running geany instance, start the new one in background. "Background" means 2 things: don't block the shell and don't steal window focus.
1. When there is already a geany instance running, but I'm currently working in another window (or even on another virtual desktop), geany should add the new files to it's running instance, but don't steal window focus.
1. When I'm currently working in geany, it should add the new files, but keep the current tab the active one.
**What is it good for ?**
I'm often using long-running scripts. They create log files and at some specific points of execution, they also create intermediate reports, lists, and other files. All of these files are opened in geany for _later_ review or (sometimes) editing. So, geany collects all these files and when I have some time, I can check for the current state. But when I'm working on something else (even when working in geany), I don't want to be interrupted. When the script finishes, it will call geany without the --background option and the final report as filename, then geany will pop up to notify me about the end f the script.
Aspect 1) is a bit special. Currently, I need to make sure that geany is already running before I start the script, otherwise the script will block as soon as geany is called the first time. Yes, I could use ps to check if geany is running and if not, call `geany filename &` but on the other hand, geany already has some code for detecting a running instance and why not use it for another purpose ? And: using just the & will not cover the focus thing.
BTW: sending the reports per mail is not an optoin, because I want to keep the files in the end. Having them via mail would require additional steps (save them, open them for editing).
Thanx
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/907
[…] "Background" means 2 things: don't block the shell […]
Yes, I could use ps to check if geany is running and if not, call `geany filename &` […]
Why can't you do just that in all cases? I see no reason why it wouldn't work if Geany is already running too. At worse, use `nohup` if you need. Going in the background, as in detaching from the parent process is annoying. It's not strictly speaking hard, but it requires some special work, and `fork()` has some annoying properties -- maybe we wouldn't care at this point, not sure. Also, I fail to see the real use case here, until I see `&` at the shell level doesn't work for soem (bad) reasons. So for this part, I'd rather say "no".
[…]
When the script finishes, it will call geany without the --background option and the final report as filename, then geany will pop up to notify me about the end f the script.
[…]
BTW: sending the reports per mail is not an optoin, because I want to keep the files in the end. Having them via mail would require additional steps (save them, open them for editing).
Hum, couldn't you simply save the files in a log directory, and open them manually/at the end?
I'm not strictly speaking against an option disabling window presentation/tab switching (although that later one might require a special handling), but I kinda fail to see the point, and the use case seem very specific and unusual. But well, I guess we'd accept a nice implementation of this part, esp. if we get convinced it's indeed really necessary for some legitimate used cases.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/907#issuecomment-185760964
Yes, I know that my use case is a bit special. That's why I asked for an option and not for a change of the default behaviour :-)
OK, I could change my scripts to use `&` generally, but it would pollute my terminal with lots of `Done` messages, even with `> /dev/null 2>&1`. Yes, I'm also checking the terminal output.
A reason against just collecting all the files and logs in a log directory is that it also would require an additional step to move them to the final location at the end. You should know that I often have mltiple of these scripts running in parallel, and then I always need to look twice which ones are ready to move and which ones should stay in the log directory. OK, I have a file naming scheme that helps, but still, I need to check which files are still written to and which ones are complete. As I wrote, I also check intermediate results when I have time (and wehen I have a feeling the script takes longer than expected).
I think it would be very ironic to put some effort in my scripts in order to automate things and then have to manage the result manually. :-) And I thought if there already is an option to be used from an external script or tool (--list-documents), my new option would fit into the scheme.
Maybe I should also note that I generally don't like to be interrupted by any application that steals the focus. Unfortunately, the "focus stealing prevention" setting of XFCE does not help with geany. I think the "don't interrupt me" aspect of this option could be useful for other people, too.
BTW: I'm surprised that my feature request can cause some potential problems. I thought the only thing that needs to be implemented is the signalling of the new option to the already running instance. All the rest is surrounding a few things with an `if() { ... }`, isn't it ?
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/907#issuecomment-185781485
All the rest is surrounding a few things with an if() { ... }, isn't it ?
So somebody should be able to submit an implementation easily :)
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/907#issuecomment-185941121
Well ... of course, "simple" means "simple for somebody who knows the project well". :-) When I wrote about "only need to put some if's around things", that was a wild guess :-) because to me as geany user, this is how it looks like: just switch off some things that geany normally does.
BTW: I've already accepted that I need to go without the background/forking part and use `&` instead. So, the option could also be named --nofocus.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/907#issuecomment-186172487
Yepp, an Option that doesn't steal focus could by nice. Especially in the case of multiple virtual desktops or a tiling wm ...
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/907#issuecomment-189881342
github-comments@lists.geany.org