Patch 9.0.0571
Problem:    MS-Windows: CTRL-C can make Vim exit.
Solution:   Check the not-a-term argument.
Files:      src/main.c, src/proto/main.pro, src/normal.c


*** ../vim-9.0.0570/src/main.c  2022-09-14 01:27:17.628593488 +0100
--- src/main.c  2022-09-24 13:06:57.676735010 +0100
***************
*** 1008,1014 ****
   * Return TRUE when the --not-a-term argument was found.
   */
      int
! is_not_a_term()
  {
      return params.not_a_term;
  }
--- 1008,1014 ----
   * Return TRUE when the --not-a-term argument was found.
   */
      int
! is_not_a_term(void)
  {
      return params.not_a_term;
  }
***************
*** 1016,1023 ****
  /*
   * Return TRUE when the --not-a-term argument was found or the GUI is in use.
   */
!     static int
! is_not_a_term_or_gui()
  {
      return params.not_a_term
  #ifdef FEAT_GUI
--- 1016,1023 ----
  /*
   * Return TRUE when the --not-a-term argument was found or the GUI is in use.
   */
!     int
! is_not_a_term_or_gui(void)
  {
      return params.not_a_term
  #ifdef FEAT_GUI
*** ../vim-9.0.0570/src/proto/main.pro  2022-06-27 23:15:13.000000000 +0100
--- src/proto/main.pro  2022-09-24 13:07:02.384713485 +0100
***************
*** 2,7 ****
--- 2,8 ----
  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);
*** ../vim-9.0.0570/src/normal.c        2022-09-24 12:50:40.602168025 +0100
--- src/normal.c        2022-09-24 13:07:42.568532210 +0100
***************
*** 6793,6803 ****
                && !VIsual_active
                && no_reason)
        {
!           int out_redir = !stdout_isatty
! #ifdef FEAT_GUI
!                               && !gui.in_use
! #endif
!                               ;
            // 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.
--- 6793,6800 ----
                && !VIsual_active
                && no_reason)
        {
!           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.
*** ../vim-9.0.0570/src/version.c       2022-09-24 13:00:50.462659700 +0100
--- src/version.c       2022-09-24 13:06:39.268819767 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     571,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
161. You get up before the sun rises to check your e-mail, and you
     find yourself in the very same chair long after the sun has set.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220924121029.893BB1C0728%40moolenaar.net.

Raspunde prin e-mail lui