James McCoy wrote:
> Since Debian Stretch released, I've been catching up on Vim patches
> however everything after 8.0.0314 was failing to build. The GUI-enabled
> Vim builds were failing this part of Test_getcmdtype.
>
> call feedkeys(":call input('Answer?')\<CR>", "t")
> call feedkeys("MyCmd a\<C-R>=Check_cmdline('@')\<CR>\<C-C>", "xt")
>
> Non-GUI enabled builds work just fine.
>
> This is related to the environment in which Debian/Ubuntu builds take
> place -- mainly, stdin is /dev/null and stdout/stderr are connected to
> pipes thus causing no_console_input()
>
> int
> no_console_input(void)
> {
> return ((!gui.in_use || gui.starting)
> # ifndef NO_CONSOLE
> && !isatty(0) && !isatty(2)
> # endif
> );
> }
>
> to return a true value. f_input() reaches this through
> get_user_input(), and returns early instead of setting up the input
> prompt.
>
> Found errors in Test_getcmdtype():
> function RunTheTest[21]..Test_getcmdtype[15]..Check_cmdline line 1:
> Expected 'MyCmd a' but got ''
> function RunTheTest[21]..Test_getcmdtype[15]..Check_cmdline line 2:
> Expected 8 but got 0
> function RunTheTest[21]..Test_getcmdtype[15]..Check_cmdline line 3:
> Expected '@' but got ''
>
> fill_input_buf() already has its own, less restrictive handling of
> environments such as this, which is why the non-GUI enabled builds work.
> Given that, the attached patch addresses the issue but I'm not sure if
> there's a better way to handle it.
I don't think this change is good when not running tests. We have the
--not-a-term argument specifically for dealing with the situation that
Vim is run without a terminal. How about doing this:
--- old/src/eval.c 2017-07-27 22:14:55.309968189 +0200
+++ eval.c 2017-07-29 15:04:39.917938522 +0200
@@ -8070,8 +8070,9 @@
rettv->vval.v_string = NULL;
#ifdef NO_CONSOLE_INPUT
- /* While starting up, there is no place to enter text. */
- if (no_console_input())
+ /* While starting up, there is no place to enter text. When running tests
+ * with --not-a-term we assume feedkeys() will be used. */
+ if (no_console_input() && !is_not_a_term())
return;
#endif
There might be other calls to no_console_input() that need to be changed.
We should not change no_console_input() itself, because there is at
least one place where it needs to work (prevent from calling GUI input
functions before the GUI has been initialized).
--
Facepalm statement #9: "Did you see, there is now even a hobbit book"
/// 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.