Unable to :sh when vim argument is a process substitution

14 views
Skip to first unread message

Gary Johnson

unread,
Oct 29, 2019, 2:08:35 AM10/29/19
to vim...@googlegroups.com
I think this is a bug. In a bash shell on a Linux system, execute
this:

$ vim -N -u NONE <(ls)

Then try to start a shell:

:sh

The command immediately returns.

I discovered a work-around, but I don't know if it works generally.
I mention it mainly to give more information to someone who might be
able to fix the underlying problem.

I created a wrapper for bash which I named mybash and put in my home
directory:

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

If I then start vim like this:

$ SHELL=$HOME/mybash vim -N -u NONE <(ls)

and execute

:sh

it _does_ work.

I don't know why vim should even be aware that its argument is the
result of a process substitution. This might even be bug in bash.

All versions of vim that I have tried exhibit the same behavior,
from 8.0.1453 through 8.1.2231. I have tried bash versions
4.1.5(1), 4.3.48(1) and 4.4.19(1).

Regards,
Gary

Bram Moolenaar

unread,
Oct 31, 2019, 7:16:19 PM10/31/19
to vim...@googlegroups.com, Gary Johnson
It looks like bash connects stdin to the file. This also fails:
:!sh
But this works:
:!sh </dev/tty

I would think this is a shell problem.

--
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
are already highlighted in purple.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages