feat: capture output and exit code of commands

+ ignore interactive commands like vim, top or nano
This commit is contained in:
wancat committed 2023-07-27 17:56:32 +08:00
1 parent d997a061a9
commit b9643e7d5c
4 files changed
+25 -5

No files matched your search

@@ -5,7 +5,7 @@ import { verifySessionJWT } from '../../utils/auth.js'
export async function newCommand(req, res) {
console.log('new command:', req.body)
const { token, command, pwd, output } = req.body
const { token, command, pwd, exit_code, output } = req.body
let sessionId
try {
@@ -27,6 +27,7 @@ export async function newCommand(req, res) {
session,
command,
pwd,
exit_code,
output,
})