2

we have a web application where we have web terminal to fire some commands from there and request goes back to server via websocket for processing and result comes to the browser and displayed back on the web-terminal.

This web terminal is developed using Angular.JS and jquery.terminal-0.10.0.js and it was working fine until we upgraded to jquery.terminal-2.19.2.js. The browser starts becoming sluggish gradually after firing commands from web terminal. The typed character on terminal and response looks as if they are printing in slow-motion, after sometime of usage.

Has anybody faced the same? Any resolutions? I have tried to upgrade to latest jquery.terminal-2.27.1.js but no improvement.

Browser: Chrome (Version 91.0.4472.12(64-bit)) and FireFox-89(64 bit)

OS: Windows-10

Jquery version- 3.5.1 (changing jquery version does not affect the issue)

Any help is appreciated.

  • I would need to have more information, maybe I will be able to reproduce your use case, with an automated stress test code. I can simulate long usage of the terminal and a lot of content printed. But I would need to more information. – jcubic Jul 16 '21 at 04:30
  • hey @jcubic , Please let me know which information you need? 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. – danish parvez Jul 16 '21 at 05:05
  • It would be nice to see what you're doing with the terminal and how long use it. So I can try to reproduce. Ideally, if you have an application online that I can test. This is more like a bug report without reproduction I can't do much. – jcubic Jul 16 '21 at 06:13
  • 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. – danish parvez Jul 16 '21 at 16:00
  • If you can't show me the code, even privately in an email then I can't help you. I don't have a magic ball that will figure out why your code doesn't work as expected, I need to have something. Maybe try to create a minimal reproducible example that I can test. – jcubic Jul 16 '21 at 19:36
  • LOL, I've spent an hour to find this in GitHub issues. You can create an issue on GitHub but you will need to create a reproduction of the error. Try to create a simplified version of the app that you can publish. You can also Open Dev tools and test performance in the profiler to see what is slowing down the application. – jcubic Aug 01 '21 at 07:49
  • 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 ? – danish parvez Aug 05 '21 at 13:20
  • I can't believe that you can't take a few minutes and create a reproduction of the error. You don't need to show your whole code that is restricted. You can write the same code from memory not looking at the original code and show what is the error. I'm afraid that if you don't show what the error is you will need to fix it yourself. – jcubic Aug 05 '21 at 15:30
  • Can you tell me in what context you're using `set_command()`? – jcubic Aug 05 '21 at 15:33
  • 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. – danish parvez Aug 05 '21 at 18:17
  • commenting-out the set_command() API resolves the sluggishness but of course then the text does not appear on web-terminal. – danish parvez Aug 05 '21 at 18:19
  • Using terminal.echo() results in the same behaviour. – danish parvez Aug 05 '21 at 19:27
  • You may have too much data in the terminal. This is happening on any website that has too many DOM nodes. – jcubic Aug 06 '21 at 07:04
  • 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? – danish parvez Aug 06 '21 at 07:19
  • version 1.0.0 added formatters in the command line, do you use formatters to color your input? By default there is only one formatted for nested formatting, formatters are in `$.terminal.defaults.formatters`. – jcubic Aug 06 '21 at 18:56

0 Answers0