Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated Terminal: 'oni2' command should open file in current editor #2297

Closed
bryphe opened this issue Aug 13, 2020 · 5 comments · Fixed by #3451
Closed

Integrated Terminal: 'oni2' command should open file in current editor #2297

bryphe opened this issue Aug 13, 2020 · 5 comments · Fixed by #3451
Labels
A-terminal Area: Integrated terminal bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor

Comments

@bryphe
Copy link
Member

bryphe commented Aug 13, 2020

Expected: When running the oni2 command to open a file, ie, oni2 some-file.txt, the expectation is that the file would open in the current_session.

Actual: A new Oni2 window is created, which isn't very useful behavior.

I thought we had an issue logged for this already - but couldn't find it.

Related to #1250 - solving that issue would likely solve this one, too. We can potentially pass an environment variable / some context so that a 'nested' Onivim 2 process knows there is already an instance running, and can let it know to open a file.

@bryphe bryphe added A-terminal Area: Integrated terminal bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor labels Aug 13, 2020
bryphe added a commit that referenced this issue Apr 23, 2021
…n files in current editor (#3451)

__Issue:__ Running `oni2 some-file.txt` in the Onivim integrated terminal opens `some-file.txt` in a new instance of Onivim, rather than the current instance.

__Defect:__ There's no context sent to the `oni2` command in the terminal to know to send to the active editor.

__Fix:__ Create a named pipe that multiple instances of Onivim can communicate through, and send the information for that pipe to the terminal.

__TODO:__
- [x] Fix CLI-specified files from opening in same split as terminal
- [x] Test on Windows
- [x] Test on Linux

Fixes #2297
@vincentjorgensen
Copy link

On MacOS, these directions here do not add the oni2 symlink to /usr/local/bin. (Nothing happens when I click on it. I am using latest b7d274a) How do I add it manually? Thank you.

@bryphe
Copy link
Member Author

bryphe commented Apr 27, 2021

Hi @vincentjorgensen ,

If the Add to Symlink command isn't working - you can run this command in terminal:

ln -fs /Applications/Onivim2.app/Contents/Resources/run.sh /usr/local/bin/oni2

(Assuming you've installed via the DMG). Hope that helps - let me know if it's still not working.

@vincentjorgensen
Copy link

vincentjorgensen commented Apr 27, 2021 via email

@CrossR
Copy link
Member

CrossR commented Apr 27, 2021

Thank you. The instructions work. However, oni2 <file> opens each new file in a new instance of the app.

That is step 2 in the process! Step 1 is this issue, i.e. have oni2 work properly inside Oni2. To my knowledge, its not been generalised to work outside the editor quite yet, as the way we communicate with the running Oni2 instance isn't accessible outside the editor right now (well it is...but we've not setup a way of locating it).

So that is working as expected right now, but keep an eye out and that should start working, once the behaviour has been expanded a little.

@vincentjorgensen
Copy link

vincentjorgensen commented Apr 27, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-terminal Area: Integrated terminal bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor
Projects
None yet
3 participants