To: vim_dev@googlegroups.com Subject: Patch 9.0.0571 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///