> I question the general utility of this if you’re not in some way proxying
for a user who’s expecting interactivity.

That's exactly what I'm doing.  I'm developing a web server where the
browser can be used as an interactive terminal.  It's part of a bigger
functionality so existing browser terminal emulators can't be used.

Thanks for the reference to pty which is new to me.  I just found this
nodejs module which may do what I want.

https://github.com/chjj/pty.js/


On Sat, Jul 20, 2013 at 11:24 AM, Aria Stewart <[email protected]> wrote:

>
>
> On 20 July 2013 at 2:14:06 PM, Mark Hahn ([email protected]) wrote:
>
> Is there anyway to spawn a process running a shell so I can send commands
> in and get results back?  Unlike normal spawn I'd like the process to not
> exit and to keep the shell's environment.  For example I'd like to be able
> to send these to one process one line at a time
>
> x=hello
> y=world
> echo $x $y
>
> What you want is a pty under unix — to actually allocate a terminal and
> talk to the shell interactively. It’s not trivial, since it becomes mixed
> error and output streams, and it’s more like scripting an interactive
> session. I question the general utility of this if you’re not in some way
> proxying for a user who’s expecting interactivity.
>
> You can manipulate the environment in process and spawn normally to get
> the equivalent of this — more like doing the shell parts yourself, and only
> spawning commands you run — in general, this is a better approach.
>
> —Aria
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to