{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/2342","labels_url":"https://api.github.com/repos/neovim/neovim/issues/2342/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/2342/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/2342/events","html_url":"https://github.com/neovim/neovim/issues/2342","id":66174124,"number":2342,"title":"Invoking with \"--cmd terminal\" causing nvim to hang.","user":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-03T15:58:16Z","updated_at":"2015-04-30T16:10:29Z","closed_at":"2015-04-30T16:10:29Z","body":"Either put the line \"terminal\" in your `.nvimrc` or from the command line...\r\n```bash\r\n$ nvim --cmd terminal\r\n```\r\nValgrind detected no memory errors.\r\n\r\nRunning through gdb and hitting `Ctrl+c` to get the backtrace:\r\n```\r\n#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38\r\n#1  0x000000000061ac28 in uv__io_poll (loop=0x8c76a8 <default_loop_struct>, timeout=<optimized out>) at /home/admin/src/neovim/.deps/build/src/libuv/src/unix/linux-core.c:211\r\n#2  0x000000000060ef98 in uv_run (loop=0x8c76a8 <default_loop_struct>, mode=UV_RUN_ONCE) at /home/admin/src/neovim/.deps/build/src/libuv/src/unix/core.c:324\r\n#3  0x00000000005fd575 in loop (run_mode=UV_RUN_ONCE) at /home/admin/src/neovim/src/nvim/os/event.c:204\r\n#4  0x00000000005fd30e in event_poll (ms=-1) at /home/admin/src/neovim/src/nvim/os/event.c:129\r\n#5  0x00000000005f6ecb in input_poll (ms=-1) at /home/admin/src/neovim/src/nvim/os/input.c:279\r\n#6  0x00000000005f6f73 in inbuf_poll (ms=-1) at /home/admin/src/neovim/src/nvim/os/input.c:296\r\n#7  0x00000000005f68ff in os_inchar (buf=0xb5b57e \"\", maxlen=71, ms=-1, tb_change_cnt=211) at /home/admin/src/neovim/src/nvim/os/input.c:95\r\n#8  0x000000000059d6ce in inchar (buf=0xb5b57e \"\", maxlen=215, wait_time=-1, tb_change_cnt=211) at /home/admin/src/neovim/src/nvim/getchar.c:2460\r\n#9  0x000000000059d315 in vgetorpeek (advance=1) at /home/admin/src/neovim/src/nvim/getchar.c:2280\r\n#10 0x000000000059b652 in vgetc () at /home/admin/src/neovim/src/nvim/getchar.c:1395\r\n#11 0x000000000059bb01 in safe_vgetc () at /home/admin/src/neovim/src/nvim/getchar.c:1515\r\n#12 0x0000000000523894 in getcmdline (firstc=58, count=1, indent=0) at /home/admin/src/neovim/src/nvim/ex_getln.c:303\r\n#13 0x0000000000526d75 in getexline (c=58, cookie=0x0, indent=0) at /home/admin/src/neovim/src/nvim/ex_getln.c:1680\r\n#14 0x0000000000550618 in do_cmdline (cmdline=0x0, fgetline=0x526d38 <getexline>, cookie=0x0, flags=3) at /home/admin/src/neovim/src/nvim/ex_docmd.c:539\r\n#15 0x000000000055d882 in ex_at (eap=0x7fffffffca20) at /home/admin/src/neovim/src/nvim/ex_docmd.c:6633\r\n#16 0x000000000055351c in do_one_cmd (cmdlinep=0x7fffffffcb40, sourcing=1, cstack=0x7fffffffcc50, fgetline=0x4bba1a <get_func_line>, cookie=0xb5a700) at /home/admin/src/neovim/src/nvim/ex_docmd.c:1914\r\n#17 0x0000000000550860 in do_cmdline (cmdline=0x0, fgetline=0x4bba1a <get_func_line>, cookie=0xb5a700, flags=7) at /home/admin/src/neovim/src/nvim/ex_docmd.c:620\r\n#18 0x00000000004bade2 in call_user_func (fp=0xb5a0c0, argcount=5, argvars=0x7fffffffd580, rettv=0x7fffffffd760, firstline=22, lastline=22, selfdict=0x0) at /home/admin/src/neovim/src/nvim/eval.c:19087\r\n#19 0x000000000049fd37 in call_func (funcname=0xb59f30 \"\\200\\375Q28_MapOp\", len=11, rettv=0x7fffffffd760, argcount=5, argvars=0x7fffffffd580, firstline=22, lastline=22, doesrange=0x7fffffffd730, evaluate=1, selfdict=0x0)\r\n    at /home/admin/src/neovim/src/nvim/eval.c:6971\r\n#20 0x000000000049f8d5 in get_func_tv (name=0xb59f30 \"\\200\\375Q28_MapOp\", len=11, rettv=0x7fffffffd760, arg=0x7fffffffd738, firstline=22, lastline=22, doesrange=0x7fffffffd730, evaluate=1, selfdict=0x0)\r\n    at /home/admin/src/neovim/src/nvim/eval.c:6837\r\n#21 0x0000000000497def in ex_call (eap=0x7fffffffd870) at /home/admin/src/neovim/src/nvim/eval.c:2707\r\n#22 0x000000000055351c in do_one_cmd (cmdlinep=0x7fffffffd990, sourcing=1, cstack=0x7fffffffdaa0, fgetline=0x5dde10 <getsourceline>, cookie=0x7fffffffe000) at /home/admin/src/neovim/src/nvim/ex_docmd.c:1914\r\n#23 0x0000000000550860 in do_cmdline (cmdline=0xb4e100 \"\\\" tComment.vim -- An easily extensible & universal comment plugin \", fgetline=0x5dde10 <getsourceline>, cookie=0x7fffffffe000, flags=7)\r\n    at /home/admin/src/neovim/src/nvim/ex_docmd.c:620\r\n#24 0x00000000005dd9f8 in do_source (fname=0xb49f80 \"/home/admin/.vim/plugged/tcomment_vim/plugin/tcomment.vim\", check_other=0, is_vimrc=0) at /home/admin/src/neovim/src/nvim/ex_cmds2.c:2474\r\n#25 0x00000000005dcbfd in source_callback (fname=0xb49f80 \"/home/admin/.vim/plugged/tcomment_vim/plugin/tcomment.vim\", cookie=0x0) at /home/admin/src/neovim/src/nvim/ex_cmds2.c:2046\r\n#26 0x00000000005dce61 in do_in_runtimepath (name=0x64a0e5 \"plugin/**/*.vim\", all=1, callback=0x5dcbd7 <source_callback>, cookie=0x0) at /home/admin/src/neovim/src/nvim/ex_cmds2.c:2127\r\n#27 0x00000000005dcc27 in source_runtime (name=0x64a0e5 \"plugin/**/*.vim\", all=1) at /home/admin/src/neovim/src/nvim/ex_cmds2.c:2057\r\n#28 0x00000000004f1ee0 in load_plugins () at /home/admin/src/neovim/src/nvim/main.c:1409\r\n#29 0x00000000004efcab in main (argc=3, argv=0x7fffffffe398) at /home/admin/src/neovim/src/nvim/main.c:309\r\n```\r\nThe `load_plugins()` codepath runs well before we have a UI, so I thought I'd try moving it to just past `ui_builtin_start()`, which hangs until the user hits `Ctrl+c`, and if it's after `screenclear()`, then everything runs normally. \r\n\r\nObviously, we don't want to move `load_plugins()` as that would cause the UI to be configured after being initialized, but perhaps we should defer the terminal command. Though, I find it a little vexing how to handle this since the whole point of `--cmd` is that the command should run because parsing `.nvimrc`."},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/97859986","html_url":"https://github.com/neovim/neovim/issues/2342#issuecomment-97859986","issue_url":"https://api.github.com/repos/neovim/neovim/issues/2342","id":97859986,"user":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T16:10:29Z","updated_at":"2015-04-30T16:10:29Z","body":"I believe this may be due to #2547 so I'll close this so future discussion can continue there."}}