Hi,

On Sun, Nov 20, 2016 at 12:50:05AM +0300, KING SABRI wrote:
> Is there any pure and native ruby way to spawn an interactive shell in *one
> line*

Since process spawning is an inherently OS-specific operation, there
can't be a pure-ruby implementation of that. If you mean "native" in the
sense that it is included in the core or stdlib, there are #spawn,
#system, IO.popen, the backticks, and given the Python code you posted,
the PTY library[1].

> Note: I tried all kind of methods like *system*, *exec*, *backticks*, ruby
> *pty* nothing works

It appears you have already found PTY. So instead of "does not work",
please be more specific about what does not work. Does it fail to spawn
the process? Does it crash with an exception?

Greetings
Marvin

[1]: http://ruby-doc.org/stdlib-2.3.2/libdoc/pty/rdoc/PTY.html

-- 
Blog: http://www.guelkerdev.de
PGP/GPG ID: F1D8799FBCC8BC4F

Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>