# HG changeset patch # User John "Elwin" Edwards # Date 1336341992 25200 # Node ID 98bf7c94c954344e6fbd506d1215f5d464eabcd0 # Parent 9bef0941c6ddfaebd06c0831f93f732059d60e6b webtty.js: set up the environment and working directory. diff -r 9bef0941c6dd -r 98bf7c94c954 webtty.js --- a/webtty.js Sun May 06 09:04:14 2012 -0700 +++ b/webtty.js Sun May 06 15:06:32 2012 -0700 @@ -7,14 +7,24 @@ var child_process = require("child_process"); var serveStaticRoot = "/home/elwin/hk/nodejs/rlg/s/"; +var ptyhelp = "/home/elwin/hk/nodejs/rlg/ptywreck/ptyhelperC"; var sessions = {}; +var env_dontuse = {"TMUX": true, "TMUX_PANE": true}; + /* Constructor for TermSessions. Note that it opens the terminal and * adds itself to the sessions dict. */ function TermSession(sessid) { + var childenv = {}; + for (var key in process.env) { + if (!(key in env_dontuse)) + childenv[key] = process.env[key]; + } + // Should setsid get set? + var spawnopts = {"env": childenv, "cwd": process.env["HOME"]}; //var pterm = tty.open("/bin/bash"); - this.child = child_process.spawn("./ptywreck/ptyhelperC", ["bash"]); + this.child = child_process.spawn(ptyhelp, ["bash"], spawnopts); var ss = this; /* Eventually we'll need to make sure the sessid isn't in use yet. */ this.sessid = sessid;