complicated shell problem
adohe-zz opened this issue · comments
TonyAdo commented
I write such code in my server side:
var tty = require('tty.js');
var app = tty.createServer({
shell: 'mongo test',
users: {
foo: 'bar'
},
port: 8000
});
app.get('/foo', function(req, res, next) {
res.send('bar');
});
app.listen();
then I type http://localhost:8000
in my browser and when I click the Open Terminal
, the terminal will not show up. And the server side log is:
[tty.js] You should sha1 your user information.
[tty.js] Listening on port 8000.
[tty.js] foo Session foo created.
[tty.js] foo Created pty (id: /dev/ttys004, master: 19, pid: 48143).
[tty.js] foo Closed pty (/dev/ttys004): 19.
It did created pty
but closed this as soon as created. But if I run this code:
var tty = require('tty.js');
var app = tty.createServer({
shell: 'mongo',
users: {
foo: 'bar'
},
port: 8000
});
app.get('/foo', function(req, res, next) {
res.send('bar');
});
app.listen();
it is ok. So I am wondering is there anything I did not notice maybe the shell format is wrong. I don't read the source code, so anyone know about this?
TonyAdo commented
Close this since I know how to do it.
Christopher Jeffrey (JJ) commented
@adohe, shell
is only the process name. For separate arguments, you'll need to use shellArgs
: { shell: 'mongo', shellArgs: ['test'] }
.