Starting with 8.2.1833, the :sh command no longer works when vim is
reading text from stdin.  The screen flashes, but nothing else
happens.

To demonstrate this, execute the following:

    $ ls | vim -N -u NONE -
    :sh

Using git bisect, I found the offending commit.

    $ git bisect bad
    204ade6bcb85f48f56e52e040d1ebf40548d92be is the first bad commit
    commit 204ade6bcb85f48f56e52e040d1ebf40548d92be
    Author: Bram Moolenaar <b...@vim.org>
    Date:   Sun Oct 11 14:58:46 2020 +0200

        patch 8.2.1833: when reading from stdin dup() is called twice

        Problem:    When reading from stdin dup() is called twice.
        Solution:   Remove the dup() in main.c. (Ken Takata, closes #7110)

     src/main.c    | 15 +++++----------
     src/version.c |  2 ++
     2 files changed, 7 insertions(+), 10 deletions(-)

The operating system I'm using is Ubuntu 20.04.1 LTS.


More information:

If before executing :sh, you set the 'shell' to /bin/cat, then
executing :sh will cause cat to report the following error.

    /bin/cat: -: Bad file descriptor
    /bin/cat: closing standard input: Bad file descriptor

This problem also occurs when one of vim's arguments is a bash
process substitution.  That's been a problem for a while.

My workaround is to detect the problematic conditions and then set
'shell' to a script containing the following.

    #!/bin/bash
    exec < /dev/tty
    exec $SHELL "$@"

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20201208063804.GC3161%40phoenix.

Raspunde prin e-mail lui