1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Vim freezes when executing an external command with zsh.
12 Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler)
16 *** ../vim-7.3.267/src/os_unix.c 2011-07-07 16:20:45.000000000 +0200
17 --- src/os_unix.c 2011-08-04 19:06:14.000000000 +0200
20 if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
22 pty_master_fd = OpenPTY(&tty_name); /* open pty */
23 ! if (pty_master_fd >= 0 && ((pty_slave_fd =
24 ! open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
26 ! close(pty_master_fd);
32 if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
34 pty_master_fd = OpenPTY(&tty_name); /* open pty */
35 ! if (pty_master_fd >= 0)
37 ! /* Leaving out O_NOCTTY may lead to waitpid() always returning
38 ! * 0 on Mac OS X 10.7 thereby causing freezes. Let's assume
39 ! * adding O_NOCTTY always works when defined. */
41 ! pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA, 0);
43 ! pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
45 ! if (pty_slave_fd < 0)
47 ! close(pty_master_fd);
53 *** ../vim-7.3.267/src/version.c 2011-08-04 19:34:55.000000000 +0200
54 --- src/version.c 2011-08-04 19:36:00.000000000 +0200
58 { /* Add new patch number below this line */
64 Mental Floss prevents moral decay!
66 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
67 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
68 \\\ an exciting new programming language -- http://www.Zimbu.org ///
69 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///