Nikolay Pavlov wrote: > 2017-07-02 23:46 GMT+03:00 Bram Moolenaar <[email protected]>: > > > > For a long time I have been wondering whether it would be a good idea to > > add a terminal emulator inside Vim. It's a dangerous thing, it can > > easily grow out of proportions and be a maintenance nightmare. At the > > same time, it can be very, very useful. > > [...] > > > I am currently exploring using libvterm for the implementation. It > > looks like this will work. Still a lot of stuff to implement, which > > might not work that well, we'll have to see. I hope to send out an > > initial patch soon, we can discuss more then. > > Debugging and tests can actually be easy to achive if you take > libvterm and Python with pexpect, I did that for powerline. (Though > Neovim with a “remote UI” based on msgpack is far more convenient > setup for most tests, excluding testing specifically terminal UI and > not just a supposed screen state, we have some of them which use > Neovim run inside a :terminal inside a Neovim which exports screen > state via its RPC API.) 4 also, but there is a big difference between > making Python “build time dependency needed for a subset of tests” and > “runtime dependency needed for a set of plugins”. > > The interesting thing is that despite Neovim has built-in terminal > emulator which allows creating special terminal buffers (I do hope you > will look at that before implementing your own variant), support has > never gone far enough to use it for `:!`, though after `:!` in Neovim > started to work through pipes and stopped displaying colors or working > with interactive apps correctly this feature started to be rather > desired. Scripting interaction with such buffers is possible both via > “switch to buffer and do :normal” and “use jobsend()” (obviously, > second variant is best practice most of time).
I have looked at terminal.c in neovim, it gives some ideas. However, both libvterm and this use of it are largely without documentation or comments. I see quite a few things in the neovim implementation where I wonder why it's done that way (in other words: looks like a bad choice). E.g. having two Vim windows on one terminal seems weird. And the round trip through a buffer to display text is weird, especially since attributes are obtained in a completely different way. Bound to introduce bugs with two conversions that seem unnecessary. Still more exploring to do. I also intend to add more documentation to libvterm along the way. I hope Paul Evans includes my changes. -- Common sense is what tells you that the world is flat. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
