Mercurial > vim
comparison src/ex_cmds.c @ 23529:049b1e867137 v8.2.2307
patch 8.2.2307: a shell command in the vimrc causes terminal output
Commit: https://github.com/vim/vim/commit/ebbf11c1198b7aec8a1a55f7231ecb4f1a432fa0
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 7 14:45:03 2021 +0100
patch 8.2.2307: a shell command in the vimrc causes terminal output
Problem: A shell command in the vimrc causes terminal output.
Solution: Do not call starttermcap() after a shell command if the termcap
wasn't active before.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 Jan 2021 15:00:05 +0100 |
parents | bb29b09902d5 |
children | f9d02c83f306 |
comparison
equal
deleted
inserted
replaced
23528:6feb235b804d | 23529:049b1e867137 |
---|---|
1358 #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) | 1358 #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) |
1359 int save_nwr; | 1359 int save_nwr; |
1360 #endif | 1360 #endif |
1361 #ifdef MSWIN | 1361 #ifdef MSWIN |
1362 int winstart = FALSE; | 1362 int winstart = FALSE; |
1363 int keep_termcap = FALSE; | 1363 #endif |
1364 #endif | 1364 int keep_termcap = !termcap_active; |
1365 | 1365 |
1366 /* | 1366 /* |
1367 * Disallow shell commands for "rvim". | 1367 * Disallow shell commands for "rvim". |
1368 * Disallow shell commands from .exrc and .vimrc in current directory for | 1368 * Disallow shell commands from .exrc and .vimrc in current directory for |
1369 * security reasons. | 1369 * security reasons. |
1393 * avoid having to type return below. | 1393 * avoid having to type return below. |
1394 */ | 1394 */ |
1395 msg_putchar('\r'); // put cursor at start of line | 1395 msg_putchar('\r'); // put cursor at start of line |
1396 if (!autocmd_busy) | 1396 if (!autocmd_busy) |
1397 { | 1397 { |
1398 #ifdef MSWIN | |
1399 if (!keep_termcap) | 1398 if (!keep_termcap) |
1400 #endif | |
1401 stoptermcap(); | 1399 stoptermcap(); |
1402 } | 1400 } |
1403 #ifdef MSWIN | 1401 #ifdef MSWIN |
1404 if (!winstart) | 1402 if (!winstart) |
1405 #endif | 1403 #endif |
1486 no_wait_return = save_nwr; | 1484 no_wait_return = save_nwr; |
1487 } | 1485 } |
1488 } | 1486 } |
1489 #endif // FEAT_GUI_MSWIN | 1487 #endif // FEAT_GUI_MSWIN |
1490 | 1488 |
1491 #ifdef MSWIN | |
1492 if (!keep_termcap) // if keep_termcap is TRUE didn't stop termcap | 1489 if (!keep_termcap) // if keep_termcap is TRUE didn't stop termcap |
1493 #endif | |
1494 starttermcap(); // start termcap if not done by wait_return() | 1490 starttermcap(); // start termcap if not done by wait_return() |
1495 | 1491 |
1496 /* | 1492 /* |
1497 * In an Amiga window redrawing is caused by asking the window size. | 1493 * In an Amiga window redrawing is caused by asking the window size. |
1498 * If we got an interrupt this will not work. The chance that the | 1494 * If we got an interrupt this will not work. The chance that the |