ruby - Send captured characters back to the process -


Now, I have the following code to capture the character in Ruby using IO.read,

  tty_param = 'stty -g' system 'stty raw -echo' capt = IO.read '/ dev / stdin', 1 system "stty # {tty_param}"  
< P> The code is called through key binding, so I can be in the middle of an application such as vim or just bash prompt, when it is called.

What am I thinking, how is it that after removing my program, do I send the characters back in my process?

Maybe you're looking for what.

Open3 gives you access to stdin, stdout, stderr and a thread when waiting for the child process while running another program. You can specify different features, redirection, current directory, etc. of the same type of program for process.Spons.


Comments