{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/2076","labels_url":"https://api.github.com/repos/neovim/neovim/issues/2076/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/2076/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/2076/events","html_url":"https://github.com/neovim/neovim/pull/2076","id":59345952,"number":2076,"title":"[WIP] Builtin terminal emulation","user":{"login":"tarruda","id":842846,"avatar_url":"https://avatars.githubusercontent.com/u/842846?v=3","gravatar_id":"","url":"https://api.github.com/users/tarruda","html_url":"https://github.com/tarruda","followers_url":"https://api.github.com/users/tarruda/followers","following_url":"https://api.github.com/users/tarruda/following{/other_user}","gists_url":"https://api.github.com/users/tarruda/gists{/gist_id}","starred_url":"https://api.github.com/users/tarruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarruda/subscriptions","organizations_url":"https://api.github.com/users/tarruda/orgs","repos_url":"https://api.github.com/users/tarruda/repos","events_url":"https://api.github.com/users/tarruda/events{/privacy}","received_events_url":"https://api.github.com/users/tarruda/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neovim/neovim/labels/terminal","name":"terminal","color":"c7def8"},{"url":"https://api.github.com/repos/neovim/neovim/labels/WIP","name":"WIP","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":60,"created_at":"2015-02-28T15:45:53Z","updated_at":"2015-03-02T16:14:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/2076","html_url":"https://github.com/neovim/neovim/pull/2076","diff_url":"https://github.com/neovim/neovim/pull/2076.diff","patch_url":"https://github.com/neovim/neovim/pull/2076.patch"},"body":"This PR uses [libvterm](http://www.leonerd.org.uk/code/libvterm/)(big thanks to @leonerd for that project) to implement a full VT220 terminal emulator using Neovim buffers and windows. ~~It will also refactor the calling of shell commands to use this facility, fixing #1044 #1386  #1496 #1716 (all caused by an issue introduced in #1365)~~~(I've decided to not touch the generic `os_call_shell` for now)\r\n\r\nStill a WIP but the `:terminal` ex command can already be used, here's a quick rundown:\r\n\r\n- `:term [prog/args]` will open a new special buffer \"connected\" to a pseudo terminal running prog/args\r\n- any command that would enter insert mode will focus the terminal buffer instead.\r\n- when focused a new mode is entered where all keys are passed directly to the program. The `<c-g><esc>` combination will return to normal mode.\r\n- new terminal-only mappings can be added with the \"t\" prefix(eg: `tnoremap <c-a> <c-g><esc>` exit terminal focus using ctrl+a)\r\n\r\n@justinmk An observation about the new `Terminal` class: It is not coupled to job control so we can  use it for implementing #901 and eventually remove all blocking messages(press enter to continue) from nvim(We could have a Terminal instance created at startup and feed all messages to it, for example)"},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/76741335","html_url":"https://github.com/neovim/neovim/pull/2076#issuecomment-76741335","issue_url":"https://api.github.com/repos/neovim/neovim/issues/2076","id":76741335,"user":{"login":"ZyX-I","id":322097,"avatar_url":"https://avatars.githubusercontent.com/u/322097?v=3","gravatar_id":"","url":"https://api.github.com/users/ZyX-I","html_url":"https://github.com/ZyX-I","followers_url":"https://api.github.com/users/ZyX-I/followers","following_url":"https://api.github.com/users/ZyX-I/following{/other_user}","gists_url":"https://api.github.com/users/ZyX-I/gists{/gist_id}","starred_url":"https://api.github.com/users/ZyX-I/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZyX-I/subscriptions","organizations_url":"https://api.github.com/users/ZyX-I/orgs","repos_url":"https://api.github.com/users/ZyX-I/repos","events_url":"https://api.github.com/users/ZyX-I/events{/privacy}","received_events_url":"https://api.github.com/users/ZyX-I/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T16:14:46Z","updated_at":"2015-03-02T16:14:46Z","body":"> I'm not sure about relying on buffer filename for autocommands since the tsl/fsl terminfo capabilities are used to set the buffer title.\r\n\r\nI am not sure it is good idea to make terminal title be the buffer name. Better to set variable like `b:terminal_title` (like `w:quickfix_title`):\r\n\r\n1. I still remember crashes due to too long file name (aurum, reported to Vim once).\r\n2. Check out what `:e` does. With `terminal://` it will reopen program which is logical, and will do this without special-casing terminal buffers. I hope you don’t want to special-case them constantly. With current situation it will try to open whatever is in title.\r\n3. Adding *lots* of special cases just for terminal does not sound like a good idea to me. TerminalOpen / TerminalClose / TerminalEnter / TerminalLeave?! You already have BufOpen, BufWipeout, BufEnter, BufLeave. No need in additional code."}}