jcubic / jquery.terminal

jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands
https://terminal.jcubic.pl
MIT License
3.12k stars 569 forks source link

Cursor animation is affected by update in interval #932

Closed jcubic closed 1 month ago

jcubic commented 6 months ago

Issue summary

If you have update every 500ms, it affect the cursor animation

Expected behavior

CSS animation is not affected by term::update()

Actual behavior

Every other blink it gives few frames without blinking

Steps to reproduce

  1. Open Timer demo https://codepen.io/jcubic/pen/PogVJmB?editors=0010
  2. focus and wait few seconds

Browser and OS

N/A

Additional notes

It may be caused by a call to reset the animation in CMD.

jcubic commented 6 months ago

The problem is that term::flush() call this code at the end:

if (enabled && !is_mobile) {
    // Firefox won't reflow the cursor automatically, so
    // hide it briefly then reshow it
    cmd_cursor.hide();
    self.oneTime(1, 'flush', function() {
        cmd_cursor.show();
    });
}

So it may be not possible to fix.

jcubic commented 1 month ago

Not sure what this code is for, but I think that I can just skip that code on update.