Skip to content

Regression in patch 8.2.1513 for regular shells #7079

@olitb

Description

@olitb

Since v8.2.1513, running a shell from vim (with :sh) leads to the parent shell (the one used to run vim in a terminal) to quit unexpectedly. This behavior is onbserved on OpenBSD-current with either bash or ksh.
This is due to the following chain of functions in os_unix.c:
mch_call_shell_fork calling (after fork, in the parent) mch_delay, calling mch_settmode (indirectly via settmode in term.c) which calls tcsetattr. But at this point the shell spawned with :sh has already called tcsetpgrp, so vim is in the background and tcsetattr triggers a SIGTTOU signal, which stops (i.e. suspends) vim. This triggers a reaction from the parent shell, etc.

In the case of a shell called from vim with :sh, vim should not touch the terminal after fork until the child shell exits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions