0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.0571: MS-Windows: CTRL-C can make Vim exit

Problem:    MS-Windows: CTRL-C can make Vim exit.
Solution:   Check the not-a-term argument.
This commit is contained in:
Bram Moolenaar
2022-09-24 13:10:04 +01:00
parent d3eafdd709
commit f7e7302acb
4 changed files with 8 additions and 8 deletions

View File

@@ -1008,7 +1008,7 @@ common_init(mparm_T *paramp)
* Return TRUE when the --not-a-term argument was found. * Return TRUE when the --not-a-term argument was found.
*/ */
int int
is_not_a_term() is_not_a_term(void)
{ {
return params.not_a_term; 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. * Return TRUE when the --not-a-term argument was found or the GUI is in use.
*/ */
static int int
is_not_a_term_or_gui() is_not_a_term_or_gui(void)
{ {
return params.not_a_term return params.not_a_term
#ifdef FEAT_GUI #ifdef FEAT_GUI

View File

@@ -6793,11 +6793,8 @@ nv_esc(cmdarg_T *cap)
&& !VIsual_active && !VIsual_active
&& no_reason) && no_reason)
{ {
int out_redir = !stdout_isatty int out_redir = !stdout_isatty && !is_not_a_term_or_gui();
#ifdef FEAT_GUI
&& !gui.in_use
#endif
;
// The user may accidentally do "vim file | grep word" and then // The user may accidentally do "vim file | grep word" and then
// CTRL-C doesn't show anything. With a changed buffer give the // CTRL-C doesn't show anything. With a changed buffer give the
// message on stderr. Without any changes might as well exit. // message on stderr. Without any changes might as well exit.

View File

@@ -2,6 +2,7 @@
int vim_main2(void); int vim_main2(void);
void common_init(mparm_T *paramp); void common_init(mparm_T *paramp);
int is_not_a_term(void); int is_not_a_term(void);
int is_not_a_term_or_gui(void);
char_u *get_gui_dialog_file(void); char_u *get_gui_dialog_file(void);
int op_pending(void); int op_pending(void);
void may_trigger_safestate(int safe); void may_trigger_safestate(int safe);

View File

@@ -699,6 +699,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
571,
/**/ /**/
570, 570,
/**/ /**/