]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0571: MS-Windows: CTRL-C can make Vim exit v9.0.0571
authorBram Moolenaar <Bram@vim.org>
Sat, 24 Sep 2022 12:10:04 +0000 (13:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 24 Sep 2022 12:10:04 +0000 (13:10 +0100)
Problem:    MS-Windows: CTRL-C can make Vim exit.
Solution:   Check the not-a-term argument.

src/main.c
src/normal.c
src/proto/main.pro
src/version.c

index 6875ee5d38739529d4b009ad19975691c7087372..c0059c1933da5368ae78b4f4718916114783a831 100644 (file)
@@ -1008,7 +1008,7 @@ common_init(mparm_T *paramp)
  * Return TRUE when the --not-a-term argument was found.
  */
     int
-is_not_a_term()
+is_not_a_term(void)
 {
     return params.not_a_term;
 }
@@ -1016,8 +1016,8 @@ is_not_a_term()
 /*
  * Return TRUE when the --not-a-term argument was found or the GUI is in use.
  */
-    static int
-is_not_a_term_or_gui()
+    int
+is_not_a_term_or_gui(void)
 {
     return params.not_a_term
 #ifdef FEAT_GUI
index be578ae27ee643a9b45d6e19b1928c8ddd3037e0..05397380ccc9b8a9ee3b1da3b1207db0983d56cb 100644 (file)
@@ -6793,11 +6793,8 @@ nv_esc(cmdarg_T *cap)
                && !VIsual_active
                && no_reason)
        {
-           int out_redir = !stdout_isatty
-#ifdef FEAT_GUI
-                               && !gui.in_use
-#endif
-                               ;
+           int out_redir = !stdout_isatty && !is_not_a_term_or_gui();
+
            // The user may accidentally do "vim file | grep word" and then
            // CTRL-C doesn't show anything.  With a changed buffer give the
            // message on stderr.  Without any changes might as well exit.
index 4368e24fc2fc352eabc2fcc51bcaf7fa637ff39f..f0f9b736039d26276349f367363a34eea9a0f615 100644 (file)
@@ -2,6 +2,7 @@
 int vim_main2(void);
 void common_init(mparm_T *paramp);
 int is_not_a_term(void);
+int is_not_a_term_or_gui(void);
 char_u *get_gui_dialog_file(void);
 int op_pending(void);
 void may_trigger_safestate(int safe);
index 1cbf5514ba043a4b7b68da03546c9c941c30ba09..ad6a9edfe732def6c35535d1106eb0eb56ea18d7 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    571,
 /**/
     570,
 /**/