|
41 | 41 | * |
42 | 42 | * broken image by Sophia Bai from the Noun Project (CC-BY) |
43 | 43 | * |
44 | | - * Date: Sun, 04 Jan 2026 17:49:14 +0000 |
| 44 | + * Date: Mon, 05 Jan 2026 11:15:40 +0000 |
45 | 45 | */ |
46 | 46 | /* global define, Map, BigInt */ |
47 | 47 | /* eslint-disable */ |
|
5497 | 5497 | // ------------------------------------------------------------------------- |
5498 | 5498 | $.terminal = { |
5499 | 5499 | version: 'DEV', |
5500 | | - date: 'Sun, 04 Jan 2026 17:49:14 +0000', |
| 5500 | + date: 'Mon, 05 Jan 2026 11:15:40 +0000', |
5501 | 5501 | // colors from https://www.w3.org/wiki/CSS/Properties/color/keywords |
5502 | 5502 | color_names: [ |
5503 | 5503 | 'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white', |
|
8781 | 8781 | // :: Display user greetings or terminal signature |
8782 | 8782 | // --------------------------------------------------------------------- |
8783 | 8783 | function show_greetings() { |
| 8784 | + // raw option needs to be the same as when echo is called |
| 8785 | + // so change of the setting doesn't affect the signature |
| 8786 | + var raw_echo = raw('echo'); |
| 8787 | + function render_signature() { |
| 8788 | + var result = self.signature(); |
| 8789 | + if (raw_echo) { |
| 8790 | + result = result.split('\n').map(function(line) { |
| 8791 | + return $.terminal.format(links(line)); |
| 8792 | + }).join('\n'); |
| 8793 | + return '<pre class="terminal-signature">' + result + '</pre>'; |
| 8794 | + } |
| 8795 | + return result; |
| 8796 | + } |
8784 | 8797 | if (settings.greetings === undefined) { |
8785 | 8798 | // signature have ascii art so it's not suite for screen readers |
8786 | | - self.echo(self.signature, {finalize: a11y_hide, formatters: false}); |
| 8799 | + self.echo(render_signature, {finalize: a11y_hide, formatters: false}); |
8787 | 8800 | } else if (settings.greetings) { |
8788 | 8801 | if (is_string(settings.greetings)) { |
8789 | 8802 | self.echo(settings.greetings); |
|
10754 | 10767 | // ------------------------------------------------------------- |
10755 | 10768 | // :: Return the terminal signature depending on the size of the terminal |
10756 | 10769 | // ------------------------------------------------------------- |
10757 | | - signature: function() { |
10758 | | - var result = signature(); |
10759 | | - if (raw('echo')) { |
10760 | | - result = result.split('\n').map(function(line) { |
10761 | | - return $.terminal.format(links(line)); |
10762 | | - }).join('\n'); |
10763 | | - return '<pre class="terminal-signature">' + result + '</pre>'; |
10764 | | - } |
10765 | | - return result; |
| 10770 | + signature: function(raw) { |
| 10771 | + return signature(); |
10766 | 10772 | }, |
10767 | 10773 | // ------------------------------------------------------------- |
10768 | 10774 | // :: returns the number of rendered lines |
|
0 commit comments