-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[RFC] TUI (Terminal UI) remote attachment - GSOC 2019 #10071
Conversation
|
The current scope of the project is to first make TUI perform remote attachment, I.e provide it the capability to become So to answer your question...once this project is completed, the TUI (when the nvim is started without |
Here is a short demo of the current progress.
Things to be completed:-
|
I don't really see the benefit. We still want just running |
I envisioned making the TUI client just an other consumer of the RPC API - which I guess will be the preferred communication method for GUI’s as well? If so, is there a need for the tight coupling between the server and TUI? |
Not sure I see the problem here. The "tight coupling" is just that the TUI is always available with nvim as a default user interface, is this not reasonable? The RPC API used will be the same. What would be the benefit of isolating the TUI as a new C project in a separate repo? Perhaps exposing reusable client code in libnvim would be useful for external GUI:s, but this could just be a build from the nvim codebase. |
It is not unreasonable as that is how the majority will use the project. I am thinking more in terms of how to organize the code, or as you mention, “exposing reusable client code in libnvim”; having the TUI as a separate directory, or pulled in as an essential requirement (like libuv). |
Reorganizing the code is fine, and something we will need to do to some extent to enable a public |
I think that we are agree, my main concern was some logical separation of libnvim and TUI. |
Sure, but it will be easier to discuss this as part of a larger plan for separation of libnvim from the rest of nvim at all. Currently libnvim is all of nvim except The RPC API is already versioned separately from nvim release version. |
+1 :) |
Here is a short demo of the current progress. Things completed:-
Things to be completed:-
Things to be checked and tested:-
|
02e7bf6
to
f0e44e9
Compare
Did remote connecting to a headless nvim ever get implemented? |
It will for 0.6 |
Is this still slated for 0.7? This feature would be incredibly useful in the HPC space (you submit a headless nvim instance as a job to a batch scheduler) as well as for headless hardware development. I took a look at the source branch, it looks like there have been some structural changes (like argument parsing) since that original work was done. Happy to chip in and take a crack at the rebase if someone with more context hasn't planned on picking this up already and they were willing to give a high level overview on what's changed since the original work was done. also, more than willing to rtfm if there are any relevant docs or specific PR's to take note of. |
I'm working on rebasing this. Getting this fully merged will done for the 0.8 cycle (focus for 0.7 will be now be to stabilize already merged features, which are a-plenty), though I plan to do this incrementally so we can get something to a testable state early in the 0.8 time frame. #17691 as the first basic step. |
Noob question: how would the clipboard be handled in that case? Also, which init.lua would be loaded on the client side? both? It would be nice if we could, for example, load both environments and execute scripts both from the server and from the client. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
It works just like any other Nvim GUI/UI frontend. All connected UIs share the same (server-side) cursor. This PR has nothing to do with cursor management nor collaborative editing. |
Throwing this out there. The spec seems to have been released for VSCode's DevContainer functionality from what I understand. |
Merged in #18375 |
The aim of the project can be summarized as:
Whenever the user starts Nvim as
nvim --connect {addr}
the Nvim will connect to the Nvim server listening to{addr}
, here{addr}
can either be apipe
address (a.b.c.d
) or atcp
address (a.b.c.d:port
). The Nvim client instance would send input to the remote Nvim server and reflects the UI of the remote Nvim server. So the Nvim client acts like any other external GUI.The final goal of this project is to make
TUI
andnvim server
to run as separate processes and communicate with each other overRPC
channel. This also results in removal ofui_bridge
completely.TODO
--connect
nvim_attach
call throughrpc channel
redraw
events from Nvim serverhandle_ui_redraw
grid_line
toraw_line
before feeding it intotui
--connect
feature.ui_bridge
to make TUI arpc client
--connect
) works withoutui_bridge
Abort trap 6
: when no server is present:set termguicolors
makes blank part of screen white --checked only on iTerm)ui_bridge
nvim --embed
job from TUI and connecting to it as a clientnvim --embed
instance--embed
is killednvim_read_stdin()
API to support reading from a non-ttystdin
term_name
,term_colors
andterm_background
server
at theclient
echo xxx | nvim
to work (nowecho xxx | nvim -
works)suspend
-restart
of TUI to work