From c78bea92dfddde52b15153306b068b59b3fe1778 Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Thu, 29 Mar 2018 23:57:55 -0400 Subject: [PATCH] Allow Terminal URI opener accept a JSON-stringified config argument --- lib/main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index 24539d9..4baeed1 100644 --- a/lib/main.js +++ b/lib/main.js @@ -24,8 +24,13 @@ export default { // Register Opener for the Terminal URI (`terminal-tab://`) this.disposables.add(atom.workspace.addOpener((uri) => { - if (uri === TERMINAL_TAB_URI) { - return new TerminalSession(); + if (uri.startsWith(TERMINAL_TAB_URI)) { + let config = {}; + const args = uri.substring(TERMINAL_TAB_URI.length); + if(args) { + config = JSON.parse(args); + } + return new TerminalSession(config); } }));