Skip to content

Commit

Permalink
Moved command execution code
Browse files Browse the repository at this point in the history
  • Loading branch information
huashengdun committed Jul 12, 2019
1 parent caee6a6 commit 8577c1c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions webssh/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8577c1c

Please sign in to comment.