Ozaki Kiichi wrote: > As far as I conformed, Vim hides cursor by cursor_off() right before back to > prompt. > > Collateral evidence: (I confirmed on Ubuntu 16.04) > > 1) TERM=ansi vim --clean > > 't_ve' and 't_vi' are empty > > 2) TERM=xterm vim --clean > > 't_ve' is '^[[?12l^[[?25h', 't_vi' is '^[[?25l' (both are not empty) > > 3) set TERM=ansi and 't_ve' and 't_vi': > > TERM=ansi vim --clean > :let &t_ve = "\e[?25h" > :let &t_vi = "\e[?25l" > :terminal > > then cursor may be invisible. > > 4) set TERM=xterm and 't_ve' and 't_vi' clear: > > TERM=xterm vim --clean > :set t_vi= > :terminal > > then cursor may be visible. > > > I propose this patch: > > https://gist.github.com/ichizok/9dafd126bb6f6d5f79878a18f5665e6f
Thanks. I could eventually reproduce the problem by running a shell in a Vim terminal window in a shell in a Vim terminal window. :-) > Note: `out_flush()` should not be in `if (term->tl_cursor_visible)` clause. > > There is a problem about cursor position and display in the following case: > > cursor.c (toggle cursor visibility) > > ```c > #include <stdio.h> > #include <string.h> > #include <unistd.h> > int main(int argc, char const* argv[]) > { > char *const show = "\e[?25h"; > char *const hide = "\e[?25l"; > const char *s = show; > if (argc > 1) { > if (strcmp(argv[1], "on") == 0) { > s = show; > } else if (strcmp(argv[1], "off") == 0) { > s = hide; > } else { > fprintf(stderr, "Usage: %s [on|off]\n", argv[0]); > return 1; > } > } > write(1, s, strlen(s)); > return 0; > } > ``` > > gcc -o cursor cursor.c > vim --clean -c terminal > > and execute './cursor off' on terminal buffer, then it occurs > descrepancy between cursor and input position. When an external program switches the cursor off then it should be off. But as soon as the program exits you are back in Vim, and the cursor will be on. Filling the buffer is still to be done... -- hundred-and-one symptoms of being an internet addict: 256. You are able to write down over 250 symptoms of being an internet addict, even though they only asked for 101. /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.