Running external process in a non-blocking way

27 views
Skip to first unread message

Marco

unread,
Apr 2, 2020, 3:13:30 PM4/2/20
to vim...@googlegroups.com
Hi,

recently an issue popped up opening PDF files from within gvim. I used this
configuration for years and it worked flawlessly. But recently something has
changed (in vim's behaviour, I guess).

I have several mappings that open external files (some blocking, some
non-blocking). And the non-blocking ones don't work any more in gvim. The
processes get killed immediately. Removing all the vim commands, it boils down
to the following examples (using xcalc as an example here):

" this works, it opens the calculator and upon closing the calculator gvim
" continues
:!xcalc

" this opens the calculator and immediately quits and returns to gvim, in the
" past it kept the process running
:!xcalc&

Did something change in vim regarding opening external processes? How can I
restore the old behaviour? Or more importantly: How can I open external
processes in a non-blocking way?

Debian-testing
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 24 2020 03:21:40)
Included patches: 1-439

Marco

Marco

unread,
Apr 5, 2020, 6:10:42 AM4/5/20
to vim...@googlegroups.com
On Thu, 2 Apr 2020 21:05:16 +0200
Marco <li...@homerow.info> wrote:

> " this works, it opens the calculator and upon closing the calculator
> gvim " continues
> :!xcalc
>
> " this opens the calculator and immediately quits and returns to
> gvim, in the " past it kept the process running
> :!xcalc&
>
> Did something change in vim regarding opening external processes? How
> can I restore the old behaviour? Or more importantly: How can I open
> external processes in a non-blocking way?

Based on a recent mailing list post, a workaround/fix is to use
setsid. This works:

:!setsid xcalc

No clue why this became necessary and what changed, but this seems
to fix it.

Marco

Paul

unread,
Apr 7, 2020, 2:01:57 PM4/7/20
to vim...@googlegroups.com
On Thu, Apr 02, 2020 at 09:05:16PM +0200, Marco wrote:
>" this works, it opens the calculator and upon closing the calculator gvim
>" continues
>:!xcalc
>
>" this opens the calculator and immediately quits and returns to gvim, in the
>" past it kept the process running
>:!xcalc&

These both behave as they should for me with 8.2.402. The former sees gvim wait for the command to exit; the latter returns immediately with both xcalc and gvim responsive.
signature.asc
Reply all
Reply to author
Forward
0 new messages