bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] terminal corruption with spawned ruby processes


From: Chet Ramey
Subject: Re: [Bug-readline] terminal corruption with spawned ruby processes
Date: Wed, 12 Apr 2017 15:14:45 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 4/11/17 5:22 PM, Eric Thompson wrote:
> Hi all, 
>    I ran into a possible problem in readline developing a library for Rake
> to aid in managing and launching processes. 
> 
> basically, if you use (ruby) Process.spawn or other ways to launch a
> subprocess that don't detach and that process inherits the stdin default
> pipe of the parent, the terminal input gets corrupted before hitting the
> child process (if that child is using readline).

This seems unwise, since ruby appears to use vfork(2).  As soon as the
child performs an execve, the parent wakes up again and tries to read
from the terminal.  At that point, you have `irb' and `pry' fighting
over input and reading inconsistent terminal settings.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]