mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Fix for zsh causing freezes on Lion
Make sure tty is opened using the same flags as when opening the pty. In particular, the O_NOCTTY was missing from the tty open call. This caused waitpid() to always return 0 and Vim would get stuck in an endless loop waiting for the child to exit.
This commit is contained in:
+13
-4
@@ -3907,11 +3907,20 @@ mch_call_shell(cmd, options)
|
||||
if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
|
||||
{
|
||||
pty_master_fd = OpenPTY(&tty_name); /* open pty */
|
||||
if (pty_master_fd >= 0 && ((pty_slave_fd =
|
||||
open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
|
||||
if (pty_master_fd >= 0)
|
||||
{
|
||||
close(pty_master_fd);
|
||||
pty_master_fd = -1;
|
||||
#if !defined(MACOS) || defined(USE_CARBONIZED)
|
||||
pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
|
||||
#else
|
||||
/* Leaving out O_NOCTTY may lead to waitpid() always returning
|
||||
* 0 on Mac OS X 10.7 thereby causing freezes. */
|
||||
pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA);
|
||||
#endif
|
||||
if (pty_slave_fd < 0)
|
||||
{
|
||||
close(pty_master_fd);
|
||||
pty_master_fd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user