mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.268
Problem: Vim freezes when executing an external command with zsh. Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler)
This commit is contained in:
@@ -3889,13 +3889,23 @@ mch_call_shell(cmd, options)
|
|||||||
if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
|
if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
|
||||||
{
|
{
|
||||||
pty_master_fd = OpenPTY(&tty_name); /* open pty */
|
pty_master_fd = OpenPTY(&tty_name); /* open pty */
|
||||||
if (pty_master_fd >= 0 && ((pty_slave_fd =
|
if (pty_master_fd >= 0)
|
||||||
open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
|
{
|
||||||
|
/* Leaving out O_NOCTTY may lead to waitpid() always returning
|
||||||
|
* 0 on Mac OS X 10.7 thereby causing freezes. Let's assume
|
||||||
|
* adding O_NOCTTY always works when defined. */
|
||||||
|
#ifdef O_NOCTTY
|
||||||
|
pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA, 0);
|
||||||
|
#else
|
||||||
|
pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
|
||||||
|
#endif
|
||||||
|
if (pty_slave_fd < 0)
|
||||||
{
|
{
|
||||||
close(pty_master_fd);
|
close(pty_master_fd);
|
||||||
pty_master_fd = -1;
|
pty_master_fd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* If not opening a pty or it didn't work, try using pipes.
|
* If not opening a pty or it didn't work, try using pipes.
|
||||||
*/
|
*/
|
||||||
|
@@ -709,6 +709,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 */
|
||||||
|
/**/
|
||||||
|
268,
|
||||||
/**/
|
/**/
|
||||||
267,
|
267,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user