0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.2638: cannot write a message to the terminal from the GUI

Problem:    Cannot write a message to the terminal from the GUI.
Solution:   Add :echoconsole and use it in the test runner. (issue #7975)
This commit is contained in:
Bram Moolenaar
2021-03-22 16:19:45 +01:00
parent 09f8b3a022
commit 4c86830fc5
9 changed files with 54 additions and 32 deletions

View File

@@ -18,10 +18,14 @@
#include "vim.h"
void
ui_write(char_u *s, int len)
ui_write(char_u *s, int len, int console UNUSED)
{
#ifdef FEAT_GUI
if (gui.in_use && !gui.dying && !gui.starting)
if (gui.in_use && !gui.dying && !gui.starting
# ifndef NO_CONSOLE
&& !console
# endif
)
{
gui_write(s, len);
if (p_wd)
@@ -33,7 +37,7 @@ ui_write(char_u *s, int len)
// Don't output anything in silent mode ("ex -s") unless 'verbose' set
if (!(silent_mode && p_verbose == 0))
{
#if !defined(MSWIN)
# if !defined(MSWIN)
char_u *tofree = NULL;
if (output_conv.vc_type != CONV_NONE)
@@ -43,9 +47,11 @@ ui_write(char_u *s, int len)
if (tofree != NULL)
s = tofree;
}
#endif
# endif
mch_write(s, len);
if (console && s[len - 1] == '\n')
fsync(1);
# if !defined(MSWIN)
if (output_conv.vc_type != CONV_NONE)