On linux, I could simply use `geany <file>` to open a file, it will reuse currently opened geany window, if any.
But, on mac there are 2 problems: - I have to use full path of `geany` executable to invoke it. - It always create a new geany window, instead of using current one.
So, how to make mac behavior same as linux ?
The one part of this multipart issue sounds like #15
Geany 1.37 does different behaviour for me on macOS. If I invoke it with no file argument then it opens a brand new Geany process and Window. However, if I invoke it with a file argument then it will open the file in the original Geany process window. This behaviour is a little unusual :-)
@simonhf what you describe is the normal behaviour of Geany on other platforms, it is a multi-tabbed application, so a request to open a file from the command line opens a new tab and the command finishes, so not tying up a terminal until you finish editing.
Of course doing that makes just `geany` without any arguments useless, so it does the only thing such a command can usefully mean, it starts a new geany.
"so it does the only thing such a command can usefully mean, it starts a new `geany`" @elextr hmmm... I would expect it to just bring into focus the `geany` window already open if there is one. Other editors -- like `SlickEdit` [1] -- have a separate command option -- like `+new` -- to force a new window to be opened... Just an idea :-)
[1] https://community.slickedit.com/index.php?topic=11803.0
@simonhf don't hijack issues, if you want to suggest a new behaviour raise an issue for it, probably on base Geany, not the OSX port unless its intended to be OSX specific.
But your post seemed to be suggesting that the OPs issue is fixed (as well as your confusion about behaviour), so this could be closed. Is that the case?
@elextr sorry, was not my intention to hijack... but rather just to clarify how things worked for me on macOS. Please go ahead and close if the original poster @kuchaguangjie has nothing to add... :-)
Closed #21.
@simonhf sadly a lot of people don't bother to reply if something is fixed for them, so I'll take your indication it works as such :)
Just a PS on the behaviour, its deliberate that way, its even in the documentation and code comments!!! :-)
It's not fixed. I just rarely use Mac, I use linux, and don't have such issue on linux.
@kuchaguangjie did you follow the workaround on #15?
@elextr No, the #15 is for 1st issue in question, that's the minor one, either write the full path or a one click per boot can fix that too, so didn't try. The 2nd issue is the major one, since I usually define command shortcuts in .bashrc or (whatever mac use) to open some common files.
And, I don't have access to Mac usually, as I mentioned above.
@kuchaguangjie ok, so if, when you get to try it, its not fixed maybe you and @simonhf can correspond about whats different between your systems as it works there.
Geany 1.37 does different behaviour for me on macOS. If I invoke it with no file argument then it opens a brand new Geany process and Window. However, if I invoke it with a file argument then it will open the file in the original Geany process window. This behaviour is a little unusual :-)
Yes, when you run Geany from the command line (without specifying any files to open), it creates a new instance (and yes, this is not quite a native behavior). I'm just trying to understand if this is some problem that makes Geany harder to use in some situations - clearly, if this happened for opening new files from the command-line, this would be annoying, but does one actually run `geany` without any files when another instance of Geany is already running?
This is in principle possible to fix by introducing one more command-line paramter to Geany to always reuse existing instance, I'm just trying to understand whether it's something worth doing (on linux running `geany` from the command lines without any files as arguments always creates a new instance so this functionality is missing in Geany itself).
@techee On unix-like desktop or mac, one use case is: Defining `alias xxx="geany some_file"`, for some very common file, and whenever I want to open it, I would simply type `xxx` in console, to open it, instead of find that folder, and double click it.
I do this a lot on linux, with both geany & vim as the editor, that's why I ask for similar behavior on mac in the first place.
@kuchaguangjie Yes, but your example doesn't open a separate Geany instance - it opens the existing instance. The only case when a separate instance is created is when you run geany without any arguments.
@techee On mac, it's fixed now, but on some older version in mac, `geany xxx` still start a new instance instead of reusing existing one, otherwise I won't have created this issue back then.
On mac, it's fixed now, but on some older version in mac...
I don't quite understand - you mean older version of macOS or older version of geany? Older Geany versions won't get updated, it's just the latest release which contains all the fixes.
@techee Read the original question, that's how the version in mac worked back then.
Yeah, the thing is that this should have always worked, no matter of what Geany version was used.
github-comments@lists.geany.org