Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:50
    jcubic commented #643
  • 10:50
    jcubic commented #643
  • 10:44
    jcubic commented #643
  • Oct 19 23:09
  • Oct 19 08:16
  • Oct 19 07:54
  • Oct 17 16:35
    jcubic commented #701
  • Oct 17 16:34
    jcubic commented #701
  • Oct 17 16:33
    jcubic commented #701
  • Oct 17 16:30
    jcubic commented #701
  • Oct 17 16:29
    jcubic commented #701
  • Oct 17 16:28
    jcubic commented #701
  • Oct 17 16:12
    himanshu007-creator commented #701
  • Oct 17 08:44
    jcubic commented #701
  • Oct 17 08:44
    jcubic commented #701
  • Oct 17 08:43
    jcubic commented #701
  • Oct 17 08:39
    jcubic closed #702
  • Oct 17 08:39
    jcubic commented #702
  • Oct 17 08:27
    mdansar786 opened #702
Jakub T. Jankiewicz
@jcubic
I can create some testing code to see how terminal behave on longer use. It may be that the memory usage is too big and the browser don't handle it, because of cache. This is the only thing I can think of.
Also if you have a project public I can try to see if there are no issue with your code (also related to the library itself).
danishjmi01
@danishjmi01
@jcubic Thanks for your inputs. if the command output is around 40 lines and I repeatedly shoot the command for just 15 seconds, then the sluggishness starts to appear. I will try with 2.11.1 and let you know.
Jakub T. Jankiewicz
@jcubic
@danishjmi01 do you have the app public or maybe on some git hosting? I can test your application, it would be much easier instead of guessing what is happening I will check the profiler and maybe memory consumption and see.
danishjmi01
@danishjmi01
Hey @jcubic , I tried with other older versions of jquery.terminal and I figured out that it was version 1.0.0 where the issue starts occuring. Until 0.11.23 it is behaving as expected. Apologies, I can't paste any of our code and you can not access the terminal via web as its not publicly available. Please let me know if any other information I can provide. Or just give me some hint where I should be able to look at my code.
Jakub T. Jankiewicz
@jcubic
@danishjmi01 do you have this application behind VPN or intranet? Maybe you can send access to my email, I will not share it anywhere. I've had cases where people send my copy of the code in an email, I can sign NDA if you want.
hello-smile6
@hello-smile6
?
Jakub T. Jankiewicz
@jcubic
This message was deleted
@hello-smile6 ...
danishjmi01
@danishjmi01
Hey @jcubic , thanks for your suggestions on this, however I am restricted by the policies of my organisation hence can't take any decision unilaterally. I have found some more hints, its the set_command() API of the terminal object that is being slowing down. Can this be helpful for you to have a look ?
Jakub T. Jankiewicz
@jcubic
@danishjmi01 I don't want you to show your whole code if you can't. But I think that you can spend a moment and try to recreate the issue you have. On how you call set_command() function.
danishjmi01
@danishjmi01
The scenario is like this- 1. We are getting the characters on the keypress event and sending them to server at backend via webSocket, the server then returns back the character to frontend, which is captured by OnMessage() callback of websocket and displayed by set_command() API of terminal object. 2. When enter is pressed, the server assumes the command is finished and it performs the processing and sends back the result via the same webSocket. The result is captured by OnMessage callback of webSocket and displayed by set_command() API of terminal object.
commenting-out the set_command() API resolves the sluggishness but of course then the text does not appear on web-terminal.
Using terminal.echo() results in the same behaviour.
Jakub T. Jankiewicz
@jcubic
I don't understand the usage of set_command() here set_command is used as a way to enter characters the same as user do this. So if user enters the characters there is no need to use set_command() from the server unless the keys users enter are different then those that are returned from server.
Also note that if you have lot of data send to terminal (if you don't have limit) the browser will slow down because there is too much DOM nodes on the page.
danishjmi01
@danishjmi01
Thanks @jcubic , sluggishness might be due to too many DOM objects. But the slugishness was negligible in 0.11.23 version of jquery.terminal and it is more severe in 1.0.0 version. Do you think any specific reason for this?
Jakub T. Jankiewicz
@jcubic
I will need to see the reproduction to be sure, I don't understand why you can create simple application that use core API without showing rest of the code. Without looking the running application I'm afraid nothing I can do. Just to let you know you will not get any help from anyone if you don't show reproduction of the bug. Bigger project even ignore stuff like this. No reproduction, sorry buy. But I want to help and try to explain that you need to help me so I can help you.
danishjmi01
@danishjmi01

// --------In Version 0.11.23-----------------------------------------------------
// :: Change the command line to the new one
// -------------------------------------------------------------
set_command: function(command) {
init_deferr.then(function() {
command_line.set(command);
});
return self;
},

// ------In version 2.28.1-------------------------------------------------------
// :: Change the command line to the new one
// -------------------------------------------------------------
set_command: function(command, silent) {
when_ready(function ready() {
// TODO: refactor to use options - breaking change
if (typeof command !== 'string') {
command = JSON.stringify(command);
}
command_line.set(command, undefined, silent);
});
return self;
},

Do you think any changes from 0.11.23 to current one can induce the issue?

Jakub T. Jankiewicz
@jcubic
and?
the current implementation looks like this:
set_command: function(command, silent) {
                when_ready(function ready() {
                    // TODO: refactor to use options - breaking change
                    if (typeof command !== 'string') {
                        command = JSON.stringify(command);
                    }
                    command_line.set(command, undefined, silent);
                });
                return self;
            },
when ready will not be async like defered.the that was updated to be compatible with promises A+
@danishjmi01 If you can't show the code even simple reproduction of the issue, you will need to debug the library yourself or use version 0.11.23
The only thing I see in lastest version is that in latest version the command line is splitted into each character. Sorry I don't understand why you need to use set_command() with data from server
another idea is cache for the formated text that is to speed up cursor movement on command line that have syntax hightlighing
danishjmi01
@danishjmi01
I understand its difficult to figureout problem without reproduction. But I am restricted by my organisation's policies. And thank you for all your suggestions and advices till now. If I manage to get approvals to share specific things, I will let you know.
Jakub T. Jankiewicz
@jcubic
@danishjmi01 you can tell your boss or whoever is in charge that I can sign the NDA and we can contact privately, maybe with an email or some other online form of communication. I'm also providing paid support if you need any.
Ra0R
@Ra0R
Hey guys, is there a possibility to create a selection of options (e.g. [start stop quit]) which can be selected with the keyboard arrows?
I skimmed the documentation and didn't find anything.
Jakub T. Jankiewicz
@jcubic
@Ra0R there is new extension, forms. see demo https://codepen.io/jcubic/pen/jOWRLex
Sorry, for the delay, I didn't notice the message
Ice Badger
@TheIceBadger_twitter
Hi, fairly new to jQuery Terminal (and JS in general) I am playing around a bit with it and was wondering if its possible to type a command in Terminal A, that can echo or do something over on Terminal B? Like a visual log of IP addresses for example :D
Jakub T. Jankiewicz
@jcubic
yes you need to create two terminals terminal jquery plugin return jquery terminal object that can be used to echo and do stuff. you need to keep two variables for both terminals and when command is executed on one terminal you call echo or exec on the other terminal.
I can create simple example if you need but I'm pretty limited right now because I don't have access to my computer. I'm using my phone. Will be back from my vacation in the end of the week.
Ice Badger
@TheIceBadger_twitter
I would love an example! I will play around with it a bit and see if I can figure it out, thanks a lot!
Ice Badger
@TheIceBadger_twitter

I think I figured it out!

var termTrace = $('#trace').terminal(function(command, term) {
        var cmd = $.terminal.parse_command(command);
        switch (cmd.name) {
            case 'echo':
                termMem.echo('Hello World');
                break;
        }
}, {
    greetings: null,
    name: 'trace',
    height: 90,
    width: 810,

});    

var termMem = $('#memory').terminal(function(command, term) {
        var cmd = $.terminal.parse_command(command);
        switch (cmd.name) {
            case 'echo':
                termTrace.echo('Hello World');
                break;
        }
    }, {
        greetings: null,
        name: 'memory',
        height: 960,
        width: 240,
    });    

This will let my type "echo" in one terminal and "Hello World" shows up in the other :D
Let me know if that's how it should be done ^^

Jakub T. Jankiewicz
@jcubic
yes exactly like this, also you can use termTrace.exec(`echo "something"`); since you have echo command on trace terminal.
Ice Badger
@TheIceBadger_twitter
Thank you so much for pointing me in the right direction, I have been stuck trying to figure it out for days!
Jakub T. Jankiewicz
@jcubic
but also with code like this if you call exec(echo) you will get infinite loop probably the browser will freeze. I'm not sure if you will get stack Overflow error.
Ice Badger
@TheIceBadger_twitter
Right now one of them just has nothing in it and I just echo things to that from another terminal, so one handles everything the other just sits there and shows stuff :D