jquery.terminal icon indicating copy to clipboard operation
jquery.terminal copied to clipboard

Export Import discards blank lines

Open ordo-n opened this issue 10 months ago • 4 comments

Issue summary

When exporting and importing the terminal view blank lines are discarded

Expected behavior

Blank lines should be preserved

Steps to reproduce

    var term = $.terminal.active();
    term.echo('1');
    term.echo('');
    term.echo('2');
    term.echo('');
    term.echo('3');
    term.echo('');
    term.echo('4');
    term.echo('');
    term.echo('5');
    term.echo('');
    term.import_view(term.export_view());

Browser and OS

Chrome, Edge

ordo-n avatar Jan 22 '25 14:01 ordo-n

Thanks for the report. The library was explicitly removing lines that were falsy.

It should be fixed on devel branch.

jcubic avatar Jan 22 '25 14:01 jcubic

I'm using:

https://cdn.jsdelivr.net/gh/jcubic/jquery.terminal@devel/js/jquery.terminal.js

It doesnt appear to have been updated yet does it usually take long?

ordo-n avatar Jan 22 '25 15:01 ordo-n

The jsDelivr CDN files are cached. You need to purge the CDN for it to be updated.

I've purged the changes. But it doesn't always work. The best way is to use commit hash instead of branch, this way you will be 100% sure you get the right version.

jcubic avatar Jan 23 '25 11:01 jcubic

The change has come through. All fixed. Thanks for the swift resolution.:)

ordo-n avatar Jan 23 '25 17:01 ordo-n