Closed newptcai closed 3 years ago
Its not currently possible. You could write a wrapper script for gnvim which detaches its process from the terminal.
@vhakulinen would you mind to explain why it is not possible? Is that just not implemented and would that be welcomed? Or is there any known technical limitation preventing this being implemented?
Not currently possible, e.g. not implemented at the moment.
@vhakulinen I was looking at gvim implementation and it seems to be utilizing fork on UNIX systems to achieve this.
https://github.com/vim/vim/blob/b9a1edfc5434f2a3ac50b1a178d3c85aa417b798/src/gui.c#L81-L100
I can take a look how much effort would be to do something similar if welcomed.
In addition to the fork
and setsid
approach, you could also spawn a new gnvim
process (with std::process::Command
) passing all the arguments to it.
Feel free to experiment. I would personally try to avoid pulling any dependencies for this sort of functionality.
In addition to the
fork
andsetsid
approach, you could also spawn a newgnvim
process (withstd::process::Command
) passing all the arguments to it.Feel free to experiment. I would personally try to avoid pulling any dependencies for this sort of functionality.
OK, thanks for the info and suggestion!
When using gvim, you can run
gvim file
from a terminal, and gvim will start detach itself from the terminal automatically.To do the same thing for
gnvim
, now I have to type(gnvim file &)
. Can we get the same behavior of gvim?