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

session detach / reattach, like screen/tmux #5035

Open
joshtriplett opened this issue Jul 11, 2016 · 25 comments
Open

session detach / reattach, like screen/tmux #5035

joshtriplett opened this issue Jul 11, 2016 · 25 comments
Labels
enhancement feature request server
Milestone

Comments

@joshtriplett
Copy link
Contributor

joshtriplett commented Jul 11, 2016

With nvim's terminal mode, if it had the ability to detach and reattach, it could serve as a replacement for screen or tmux.

This would require a few additional bits:

  • A :detach function, to stop running the text UI and daemonize into a --headless instance that will survive the current user session ending.
  • A command-line argument to list running nvim instances.
  • Command-line arguments to attach to a running nvim instance and start the text UI. These need three variations: one that just fails if the session already has an attached text UI, one that detaches any attached text UI first (like screen -D -R), and one that attaches without detaching any other attached text UI (like screen -x). (That last one is optional, but I'd find it quite useful.)

cc @jameysharp

@justinmk
Copy link
Member

See #2706 (comment)

@justinmk justinmk added enhancement feature request server labels Jul 11, 2016
@justinmk justinmk added this to the unplanned milestone Jan 17, 2017
@justinmk justinmk changed the title Please support detaching and reattaching, like screen/tmux support detach and reattach, like screen/tmux Jan 17, 2017
@justinmk justinmk changed the title support detach and reattach, like screen/tmux session detach / reattach, like screen/tmux Jan 17, 2017
@gsf
Copy link

gsf commented Mar 21, 2017

A lightweight way to do this at present that's working well for me is to let abduco handle the session management:

abduco -A nvim-session nvim

@lf-
Copy link
Contributor

lf- commented May 24, 2017

I'm currently using dtach for this: dtach -A /tmp/nvim-sess -ze '^q' -r ctrl_l nvim, but obviously I'm interested in this happening.

@justinmk
Copy link
Member

justinmk commented Apr 6, 2018

reference for daemonize procedure:

@rashil2000
Copy link

Are there any plans for this? I use Neovim on Windows, but Windows lacks any terminal multiplexers (tmux works only in Msys2/Cygwin and that too only in mintty terminal).

Splits/panes etc. for shells works fine, but Neovim is obviously missing the main tmux feature that is attach/detach.

@aleksandersumowski
Copy link

@hoschi
Copy link

hoschi commented May 6, 2021

@rashil2000 original Veonim had that feature as well, here is a fork of it https://github.com/smolck/uivonim
I don't know if there is another client implemented it which supports Windows.

@rashil2000

This comment has been minimized.

@hoschi
Copy link

hoschi commented May 6, 2021

@rashil2000
my point was that this feature is already implemented in core, but not in the TUI. Neovim is already split up into server/client. In a few works the TUI delivered by core spawns and connects to one Neovim instance. What you miss here is the ability to manage different servers, which is not implemented in TUI.
Veonim implemented the server management. Unfortunately the original repository went away, here is a deep link to the functionality you want from my personal fork: https://github.com/hoschi/veonim/blob/master/docs/readme.md#multiple-concurrent-neovim-instances
I guessed, but not researched, that the fork I posted has the same functionality and you can find it by reading the docs.

In general, I just suggested searching for a client which implements the management of multiple Neovim instances ... which runs on Windows. A starting point would be the wiki which lists different clients.

@rashil2000

This comment has been minimized.

@Benjamin-Davies
Copy link

Neovide has recently gained support for connecting to a remote Neovim instance over TCP (as detailed in the README). However, I don't think it's in the stable release, so you might have to build from source.

@rashil2000
Copy link

@Benjamin-Davies Wow, that looks interesting, will try building from source to check it out.

@lucc
Copy link
Contributor

lucc commented May 7, 2021

@rashil2000 there is the pr #8246 but it stalled for a long time now. I think that might be what you want.

@rashil2000
Copy link

There is actually another one on similar lines #10071, which allows the TUI to connect to a headless nvim server. While not exactly same as attaching/detaching, it will allow us to connect similarly to tmux servers (which can be listed by, for example tmux ls).

@nawordar
Copy link
Contributor

nawordar commented Jul 9, 2021

This would be even more useful, if all instances could see the same opened buffers as it is possible with Emacs. This is something I miss from Emacs, as it allowed to use i3wm for managing window layout

@TamaMcGlinn

This comment has been minimized.

@lucc

This comment has been minimized.

@TamaMcGlinn

This comment has been minimized.

@rashil2000

This comment has been minimized.

@bfredl
Copy link
Member

bfredl commented Jul 15, 2021

There's also https://github.com/martanne/abduco for just the session management part (which can be combined with nvim for the multiplexing part)

@rashil2000
Copy link

(which unfortunately doesn't work on Windows)

@lucc

This comment has been minimized.

@hoschi

This comment has been minimized.

@mark-i-m

This comment has been minimized.

@hoschi

This comment has been minimized.

@neovim neovim locked as off-topic and limited conversation to collaborators Sep 24, 2021
@bfredl bfredl modified the milestones: 0.6, 0.7 Oct 31, 2021
@bfredl bfredl modified the milestones: 0.9, 0.10 Apr 7, 2023
@dundargoc dundargoc modified the milestones: 0.10, backlog Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement feature request server
Projects
None yet
Development

No branches or pull requests