Skip to content

Commit 401e72e

Browse files
committed
fix swallowing partials with with echo a function #1037
1 parent 9b7735b commit 401e72e

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* fix updating echo functions that return HTML (with `raw: true`) [#1029](https://github.com/jcubic/jquery.terminal/issues/1029)
1515
* fix `--terminal-scrollbar` CSS variable
1616
* fix refresh of echo command when formatters change [#1013](https://github.com/jcubic/jquery.terminal/issues/1013)
17+
* fix swallowing echo `newline: false` with a function [#1037](https://github.com/jcubic/jquery.terminal/issues/1037)
1718

1819
## 2.45.1/2.45.2
1920
### Bugfix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
99
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
1010
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
11-
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&e1634d1f9a832d04e5a48e61b1f2fa0c)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
11+
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&b0a71d010d6f672075e9b554b5dd4341)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
1212
![NPM Downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
1313
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded&n=1)](https://www.jsdelivr.com/package/npm/jquery.terminal)
1414
[![Paid Support](https://img.shields.io/badge/paid-support-354465.svg)](https://support.jcubic.pl/)

__tests__/__snapshots__/terminal.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ exports[`Terminal utils $.terminal.from_ansi should format plots with moving cur
311311
[[;#5FF;#00A] ][[;#FFF;#AAA]│] [[;#000;#AAA]Are you sure?] [[;#000;#AAA]│][[;#555;#000] ]
312312
[[;#5FF;#00A] ][[;#FFF;#AAA]│] [[;#000;#AAA]│][[;#555;#000] ]
313313
[[;#5FF;#00A] ][[;#FFF;#AAA]├────────────────────────────][[;#000;#AAA]┤][[;#555;#000] ]
314-
[[;#5FF;#00A] ][[;#FFF;#AAA]│][[;#000;#AAA] ][[;#FFF;#00A]<][[;#FF5;#00A] ]o[[;#000;#AAA]<][[;#555;#AAA] ][[;#A00;#AAA]T][[;#555;#AAA]ak ][[;#000;#AAA]> ][[;#FFF;#00A]<][[;#FF5;#00A] ][[;#FFF;#00A]N][[;#FF5;#00A]ie ][[;#FFF;#00A]>][[;#000;#AAA] ][[;#000;#AAA]│][[;#555;#000] ]
314+
[[;#5FF;#00A] ][[;#FFF;#AAA]│][[;#000;#AAA] ][[;#FFF;#00A]<][[;#FF5;#00A] ][[;#000;#AAA]<][[;#555;#AAA] ][[;#A00;#AAA]T][[;#555;#AAA]ak ][[;#000;#AAA]> ][[;#FFF;#00A]<][[;#FF5;#00A] ][[;#FFF;#00A]N][[;#FF5;#00A]ie ][[;#FFF;#00A]>][[;#000;#AAA] ][[;#000;#AAA]│][[;#555;#000] ]
315315
[[;#5FF;#00A] ][[;#FFF;#AAA]└][[;#000;#AAA]────────────────────────────┘][[;#555;#000] ]
316316
[[;#5FF;#00A] ]
317317

__tests__/terminal.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5275,8 +5275,8 @@ describe('Terminal plugin', function() {
52755275
expect(exported_view.mask).toEqual(mask);
52765276
expect(exported_view.command).toEqual(command);
52775277
expect(exported_view.lines[0][0]).toEqual('Hello World!');
5278-
expect(exported_view.lines[1][0]).toEqual('> foo');
5279-
expect(exported_view.lines[2][0]).toEqual('> bar');
5278+
expect(exported_view.lines[1][0]()).toEqual('> foo');
5279+
expect(exported_view.lines[2][0]()).toEqual('> bar');
52805280
expect(exported_view.interpreters.size()).toEqual(1);
52815281
var top = exported_view.interpreters.top();
52825282
expect(top.interpreter).toEqual($.noop);

js/jquery.terminal-src.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@
18561856
return acc + arg;
18571857
});
18581858
}
1859-
return arg;
1859+
return acc + arg;
18601860
});
18611861
};
18621862
} else if (args.some(is_promise)) {
@@ -7000,9 +7000,9 @@
70007000
};
70017001
}
70027002
// ---------------------------------------------------------------------
7003-
// :: debug logger - default no op
7003+
// :: debug logger
70047004
// ---------------------------------------------------------------------
7005-
$.terminal.debug = function() { }; // eslint-disable-line no-empty-function
7005+
$.terminal.debug = $.noop;
70067006
// ---------------------------------------------------------------------
70077007
// :: Replace terminal formatting with html
70087008
// ---------------------------------------------------------------------

js/jquery.terminal.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Sun, 04 Jan 2026 15:13:05 +0000
44+
* Date: Sun, 04 Jan 2026 17:49:14 +0000
4545
*/
4646
/* global define, Map, BigInt */
4747
/* eslint-disable */
@@ -1856,7 +1856,7 @@
18561856
return acc + arg;
18571857
});
18581858
}
1859-
return arg;
1859+
return acc + arg;
18601860
});
18611861
};
18621862
} else if (args.some(is_promise)) {
@@ -5497,7 +5497,7 @@
54975497
// -------------------------------------------------------------------------
54985498
$.terminal = {
54995499
version: 'DEV',
5500-
date: 'Sun, 04 Jan 2026 15:13:05 +0000',
5500+
date: 'Sun, 04 Jan 2026 17:49:14 +0000',
55015501
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
55025502
color_names: [
55035503
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -7000,9 +7000,9 @@
70007000
};
70017001
}
70027002
// ---------------------------------------------------------------------
7003-
// :: debug logger - default no op
7003+
// :: debug logger
70047004
// ---------------------------------------------------------------------
7005-
$.terminal.debug = function() { }; // eslint-disable-line no-empty-function
7005+
$.terminal.debug = $.noop;
70067006
// ---------------------------------------------------------------------
70077007
// :: Replace terminal formatting with html
70087008
// ---------------------------------------------------------------------

js/jquery.terminal.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.terminal.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/pipe.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,16 @@
479479
}
480480
});
481481
};
482-
options = $.extend({ onClear: onClear }, options);
482+
options = $.extend({onClear: onClear}, options);
483483
}
484484
var ret = orig.echo(arg, options, deferred);
485485
term.echo = orig_echo;
486486
return ret;
487-
} catch(e) {
487+
} catch (e) {
488+
/* eslint-disable no-console */
488489
console.error(e.message);
489490
console.error(e.stack);
491+
/* eslint-enable no-console */
490492
return term;
491493
}
492494
};

0 commit comments

Comments
 (0)