diff --git a/client/modules/terminal-run.js b/client/modules/terminal-run.js index 01cadf38..fa39ddc9 100644 --- a/client/modules/terminal-run.js +++ b/client/modules/terminal-run.js @@ -4,6 +4,7 @@ const {promisify} = require('es6-promisify'); const tryToCatch = require('try-to-catch/legacy'); +const fullstore = require('fullstore/legacy'); require('../../css/terminal.css'); @@ -26,6 +27,8 @@ let Loaded; let Terminal; let Socket; +const exitCodeStore = fullstore(); + const loadAll = async () => { const {prefix} = CloudCmd; @@ -67,12 +70,11 @@ module.exports.show = promisify((options = {}, fn) => { Terminal.focus(); }, afterClose: (/* exec.series args */) => { - fn(); + fn(null, exitCodeStore()); }, }); }); - module.exports.hide = hide; function hide () { @@ -128,7 +130,9 @@ function create(createOptions) { } }); - Socket.on('exit', () => { + Socket.on('exit', (code) => { + exitCodeStore(code); + if (autoClose) return hide(); diff --git a/package.json b/package.json index 378fcdc4..5415f92d 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,7 @@ "extract-text-webpack-plugin": "^4.0.0-alpha.0", "fast-async": "^7.0.6", "file-loader": "^3.0.1", - "gritty": "^4.0.0", + "gritty": "^4.6.0", "gunzip-maybe": "^1.3.1", "html-looks-like": "^1.0.2", "html-webpack-plugin": "^3.0.7",