diff --git a/lib/client/terminal.js b/lib/client/terminal.js index de4a98fa..0c73b171 100644 --- a/lib/client/terminal.js +++ b/lib/client/terminal.js @@ -11,6 +11,7 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal; MouseBinded, Term, Key = CloudCmd.Key, + ESC = Key.ESC, Images = DOM.Images, Notify = DOM.Notify, @@ -86,8 +87,7 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal; } function listener(event) { - var keyCode = event.keyCode, - ESC = Key.ESC; + var keyCode = event.keyCode; if (keyCode === ESC) CloudCmd.View.hide(); @@ -105,8 +105,17 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal; Term.on('keydown', listener); Term.on('data', function(data) { - if (data) - socket.emit(CHANNEL, data); + var code; + + if (data) { + code = data.charCodeAt(0); + + /* when back to term + * first simbol wasn't wrote + */ + if (code !== ESC) + socket.emit(CHANNEL, data); + } }); //Term.resize(size.cols, size.rows);