Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 01 13:11
    sberlinux edited #706
  • Nov 30 19:20
    jcubic opened #714
  • Nov 28 17:27
    jcubic labeled #708
  • Nov 28 16:27
    jcubic closed #706
  • Nov 28 16:25
    jcubic labeled #710
  • Nov 28 16:24
    jcubic opened #711
  • Nov 28 13:24
    jcubic edited #710
  • Nov 28 13:24
    jcubic labeled #710
  • Nov 28 13:24
    jcubic opened #710
  • Nov 25 14:30
    jcubic labeled #709
  • Nov 25 14:30
    jcubic opened #709
  • Nov 25 13:48
    jcubic opened #708
  • Nov 25 13:48
    jcubic labeled #708
  • Nov 23 18:28
    jcubic commented #707
  • Nov 23 18:28
    jcubic commented #707
  • Nov 23 16:03
    AlexandrosAlexiou commented #707
  • Nov 20 15:44
    AlexandrosAlexiou edited #707
  • Nov 20 15:44
    AlexandrosAlexiou edited #707
  • Nov 20 15:43
    AlexandrosAlexiou edited #707
Jakub T. Jankiewicz
@jcubic
@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
sysc4ll
@sysc4ll_gitlab
hello, how to clear the screen with clear() command, but display the greetings message like the start
please
Jakub T. Jankiewicz
@jcubic
You need to use onClear: function() { } option
best is to put the greetings into variable and echo it in onClear.
sysc4ll
@sysc4ll_gitlab
when i use clear command in my term, there is a bug. Look here : https://pixshare.de/image/screenshot-2021-11-07-15-39-29.vfI7W
the prompt cursor is under the prompt
Jakub T. Jankiewicz
@jcubic
Do you have a demo online? It's hard ot say without seeing the code
sysc4ll
@sysc4ll_gitlab
no :( i have not. Sorry. But i can paste my code on pastebin
sysc4ll
@sysc4ll_gitlab
i understand, sorry to have disturb you, I'll be back later with a little line of code. But it seems to be a little bug. Good evening
Jakub T. Jankiewicz
@jcubic
You need to give me a way to reproduce the issue, either by creating demo online. you can use git to put your code (or gitlab looking at your username)
sysc4ll
@sysc4ll_gitlab
thanks
Jakub T. Jankiewicz
@jcubic
I also need to know what browser and system your using and which version of the library
sysc4ll
@sysc4ll_gitlab
I'll be back later with all of that, thanks again
sysc4ll
@sysc4ll_gitlab
hi! firefox: 94.0.1 your lib: 2.29.4 (npm version)
I'm on 4G in a hospital, i can't route port to my laptop from my smartphone
but i can upload my code in a tar.gz or zip
in private please
Jakub T. Jankiewicz
@jcubic
@sysc4ll_gitlab you can send it my email jcubic@onet.pl
sysc4ll
@sysc4ll_gitlab
thank you :)
sysc4ll
@sysc4ll_gitlab
it's send