Wednesday, October 13, 2021

Re: upgrading past 8.2.2918 loses access to /dev/tty from athena gvim

On Wed, Oct 13, 2021 at 8:54 AM raf <raf@raf.org> wrote:
>
> Hi,
>
> macos-10.14.6
> ./configure --disable-darwin --with-x --enable-gui=athena --with-features=huge
>
> I just upgraded vim from approximately 8.2.2550 to 8.2.3501
> and something important has stopped working (from gvim).
>
> I have an autocommand group for editing gpg1-encrypted files.
> It executes gpg1 via a shell and that requires access to /dev/tty.
>
> Before the upgrade, it worked in vim and (athena) gvim (i.e.
> it would ask me for the passphrase). After the upgrade, it no
> longer works in athena gvim. gpg reports:
>
> gpg: cannot open tty `/dev/tty': Device not configured
>
> The last version where this works is 8.2.2918.
> The first version that doesn't work is:
>
> 8.2.2919: using ":!command" does not work if it uses posix_spawn()
>
> That patch removed this:
>
> diff --git a/src/os_unix.c b/src/os_unix.c
> index 20c61106f..0a4f0e698 100644
> --- a/src/os_unix.c
> +++ b/src/os_unix.c
> @@ -4775,11 +4775,6 @@ mch_call_shell_fork(
> // push stream discipline modules
> if (options & SHELL_COOKED)
> setup_slavepty(pty_slave_fd);
> -# ifdef TIOCSCTTY
> - // Try to become controlling tty (probably doesn't work,
> - // unless run by root)
> - ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
> -# endif
> }
> # endif
> set_default_child_environment(FALSE);
>
> If I run :!tty, it outputs /dev/ttys007, so I tried
> replacing "!gpg1" in the commands with "!GPG_TTY=`tty` gpg1"
> in the latest version, but that didn't work.
>
> Any idea what I need to do to restore access to /dev/tty
> from the athena gui? Or do I have to downgrade to 8.2.2918
> and stay there?
>
> cheers,
> raf


Since you wrote:

> The last version where this works is 8.2.2918.
> The first version that doesn't work is:

Then the regression is introduced by:

commit 6a43b37b760347b9a1bedf12e41b458000922969 (tag: v8.2.2919)
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 1 20:48:40 2021 +0200

patch 8.2.2919: using ":!command" does not work if it uses posix_spawn()

Problem: Using ":!command" does not work if the command uses
posix_spawn().
Solution: Do not call ioctl() with TIOCSCTTY. (Felipe Contreras)


Perhaps Felipe Contreras (added in copy) can check your patch.

Regards
Dominique

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_gE8PPR-LdVBgLs4KtYrZviemJM1rdd0xHdSX0Bn6v_Jw%40mail.gmail.com.

No comments:

Post a Comment