From 8577c1c845b97b09428cbf503118c3eb627a8824 Mon Sep 17 00:00:00 2001 From: Sheng Date: Fri, 12 Jul 2019 23:20:34 +0800 Subject: [PATCH] Moved command execution code --- webssh/static/js/main.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js index f3377c5..0545ff2 100644 --- a/webssh/static/js/main.js +++ b/webssh/static/js/main.js @@ -341,12 +341,6 @@ jQuery(function($){ if (!term.resized) { resize_terminal(term); term.resized = true; - - if (url_opts_data.command) { - setTimeout(function () { - sock.send(JSON.stringify({'data': url_opts_data.command+'\r'})); - }, 500); - } } } } @@ -476,6 +470,11 @@ jQuery(function($){ term.focus(); state = CONNECTED; title_element.text = url_opts_data.title || default_title; + if (url_opts_data.command) { + setTimeout(function () { + sock.send(JSON.stringify({'data': url_opts_data.command+'\r'})); + }, 500); + } }; sock.onmessage = function(msg) {