oni icon indicating copy to clipboard operation
oni copied to clipboard

[Feature request] If Oni is already open, opening a text file from a file explorer should open in existing instance

Open sullyj3 opened this issue 6 years ago • 9 comments

Whereas currently a new instance will be launched for each file Eg double clicked in windows explorer, or opened by any other means external to Oni's UI.

sullyj3 avatar Aug 14 '18 05:08 sullyj3

@sullyj3 In the context of individual files to be edited, this makes sense. But if you have a project open in an instance and want to perform a single operation this does not seem productive, would you care to elaborate?

badosu avatar Aug 14 '18 17:08 badosu

I'm not sure I understand, could you clarify what you mean by "perform a single operation"?

sullyj3 avatar Aug 15 '18 15:08 sullyj3

Editing a file outside the current project tree

Em Qua, 15 de ago de 2018 12:57, James Sully [email protected] escreveu:

I'm not sure I understand, could you clarify what you mean by "perform a single operation"?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/onivim/oni/issues/2503#issuecomment-413243224, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVNoKdLGTs7LuTPcLTxvwWQm-BYYLToks5uRET7gaJpZM4V70Vb .

badosu avatar Aug 15 '18 16:08 badosu

I just tried the latest Oni to see if its ready for me and this one is a show stopper. My project is composed of multiple small projects in /opt/ and this makes it impossible to work with. Oni should open up a file into an window if it has the same root path and if it doesn't then just open up into the last focused window. I keep 3-5 Nautilus file editor tabs open to different directories and I like to load from there. I'm only working into a single repository about 20% of the time.

dschissler avatar Aug 15 '18 18:08 dschissler

I think @badosu is meaning if I have a project open, and I double click a random file, do I want it to open in that same oni instance as my project, since it has nothing to do with my project? I expect the answer to some people is yes, and some no.

In general, I'd really like this. Especially for the more trivial cases, where it makes no sense to open multiple instances (ie on Windows if you highlight 3 files and open them, it opens 3 instances not 1!).

The ability to always open in the same instance should be a config option though, since it is possible you wouldn't want it.

I think if we get the opening in existing sorted first, then we can look at picking out the best candidate to open in (as spoken about above)?

Not sure how other editors work, but from a quick test, VSCode always opens in the same instance (there is maybe an option for it, didn't check).

CrossR avatar Aug 15 '18 21:08 CrossR

Maybe drag and drop will make this less contentious when it arrives, as the the option of opening a new instance and dropping onto it will be available.

sullyj3 avatar Aug 16 '18 01:08 sullyj3

Probably, the best behavior which can get better UX is to allow user to open file in the last active Oni instance and at the same time to allow user to move current tab out of the current instance to the new one. I am pretty sure that in order to achieve such it should be done some multi-platform workarounds. However, it's pretty cool to have such similarity to VSCode or Sublime Text.

iamkarlson avatar Aug 21 '18 14:08 iamkarlson

Does anyone have a working solution to this? The Oni editor tech is good for me but I still can't use Oni because I don't have a sane way to get Oni to open the files. I wonder how many people are out there who like Oni but just can't realistically use it as it is now. I'd really like to know how the existing users manage to use Oni as it is now.

dschissler avatar Feb 08 '19 04:02 dschissler

@dschissler
I have a working solution for you https://github.com/haifengkao/oni-unofficial/tree/SingleInstance

haifengkao avatar Jul 25 '19 18:07 haifengkao