Skip to content

Commit

Permalink
clear extended commands from view when calling import_view #690
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Sep 12, 2021
1 parent 296ae0f commit c87b3eb
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 84 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@
* fix echo newline when one of the values is promise or function
* fix invalid css when partial output is no longer partial
* add padding to terminal size i `term::geometry()` [#686](https://github.com/jcubic/jquery.terminal/issues/686)
* clear extended commands from view when calling `import_view` [#690](https://github.com/jcubic/jquery.terminal/issues/7690)

## 2.29.1
### Bugfix
Expand Down
52 changes: 25 additions & 27 deletions js/jquery.terminal-2.29.1.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 08 Sep 2021 18:31:52 +0000
* Date: Sun, 12 Sep 2021 11:39:53 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5033,7 +5033,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 08 Sep 2021 18:31:52 +0000',
date: 'Sun, 12 Sep 2021 11:39:53 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -7883,34 +7883,32 @@
display_exception(e, 'FORMATTING');
}
}
if (line_settings.exec) {
var parts = string.split(format_exec_split_re);
string = $.map(parts, function(string) {
if ($.terminal.is_extended_command(string)) {
// redraw should not execute commands and it have
// and lines variable have all extended commands
string = string.replace(/^\[\[|\]\]$/g, '');
if (line_settings.exec) {
line.options.exec = false;
var trim = string.trim();
if (prev_exec_cmd && prev_exec_cmd === trim) {
var parts = string.split(format_exec_split_re);
string = $.map(parts, function(string) {
if ($.terminal.is_extended_command(string)) {
// redraw should not execute commands and it have
// and lines variable have all extended commands
string = string.replace(/^\[\[|\]\]$/g, '');
if (line_settings.exec) {
line.options.exec = false;
var trim = string.trim();
if (prev_exec_cmd && prev_exec_cmd === trim) {
prev_exec_cmd = '';
self.error(strings().recursiveLoop);
} else {
prev_exec_cmd = trim;
$.terminal.extended_command(self, string, {
invokeMethods: line_settings.invokeMethods
}).then(function() {
prev_exec_cmd = '';
self.error(strings().recursiveLoop);
} else {
prev_exec_cmd = trim;
$.terminal.extended_command(self, string, {
invokeMethods: line_settings.invokeMethods
}).then(function() {
prev_exec_cmd = '';
});
}
});
}
return '';
} else {
return string;
}
}).join('');
}
return '';
} else {
return string;
}
}).join('');
if (string === '') {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.29.1.min.js

Large diffs are not rendered by default.

48 changes: 23 additions & 25 deletions js/jquery.terminal-src.js
Expand Up @@ -7883,34 +7883,32 @@
display_exception(e, 'FORMATTING');
}
}
if (line_settings.exec) {
var parts = string.split(format_exec_split_re);
string = $.map(parts, function(string) {
if ($.terminal.is_extended_command(string)) {
// redraw should not execute commands and it have
// and lines variable have all extended commands
string = string.replace(/^\[\[|\]\]$/g, '');
if (line_settings.exec) {
line.options.exec = false;
var trim = string.trim();
if (prev_exec_cmd && prev_exec_cmd === trim) {
var parts = string.split(format_exec_split_re);
string = $.map(parts, function(string) {
if ($.terminal.is_extended_command(string)) {
// redraw should not execute commands and it have
// and lines variable have all extended commands
string = string.replace(/^\[\[|\]\]$/g, '');
if (line_settings.exec) {
line.options.exec = false;
var trim = string.trim();
if (prev_exec_cmd && prev_exec_cmd === trim) {
prev_exec_cmd = '';
self.error(strings().recursiveLoop);
} else {
prev_exec_cmd = trim;
$.terminal.extended_command(self, string, {
invokeMethods: line_settings.invokeMethods
}).then(function() {
prev_exec_cmd = '';
self.error(strings().recursiveLoop);
} else {
prev_exec_cmd = trim;
$.terminal.extended_command(self, string, {
invokeMethods: line_settings.invokeMethods
}).then(function() {
prev_exec_cmd = '';
});
}
});
}
return '';
} else {
return string;
}
}).join('');
}
return '';
} else {
return string;
}
}).join('');
if (string === '') {
return;
}
Expand Down
52 changes: 25 additions & 27 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 08 Sep 2021 18:31:52 +0000
* Date: Sun, 12 Sep 2021 11:39:53 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5033,7 +5033,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 08 Sep 2021 18:31:52 +0000',
date: 'Sun, 12 Sep 2021 11:39:53 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -7883,34 +7883,32 @@
display_exception(e, 'FORMATTING');
}
}
if (line_settings.exec) {
var parts = string.split(format_exec_split_re);
string = $.map(parts, function(string) {
if ($.terminal.is_extended_command(string)) {
// redraw should not execute commands and it have
// and lines variable have all extended commands
string = string.replace(/^\[\[|\]\]$/g, '');
if (line_settings.exec) {
line.options.exec = false;
var trim = string.trim();
if (prev_exec_cmd && prev_exec_cmd === trim) {
var parts = string.split(format_exec_split_re);
string = $.map(parts, function(string) {
if ($.terminal.is_extended_command(string)) {
// redraw should not execute commands and it have
// and lines variable have all extended commands
string = string.replace(/^\[\[|\]\]$/g, '');
if (line_settings.exec) {
line.options.exec = false;
var trim = string.trim();
if (prev_exec_cmd && prev_exec_cmd === trim) {
prev_exec_cmd = '';
self.error(strings().recursiveLoop);
} else {
prev_exec_cmd = trim;
$.terminal.extended_command(self, string, {
invokeMethods: line_settings.invokeMethods
}).then(function() {
prev_exec_cmd = '';
self.error(strings().recursiveLoop);
} else {
prev_exec_cmd = trim;
$.terminal.extended_command(self, string, {
invokeMethods: line_settings.invokeMethods
}).then(function() {
prev_exec_cmd = '';
});
}
});
}
return '';
} else {
return string;
}
}).join('');
}
return '';
} else {
return string;
}
}).join('');
if (string === '') {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit c87b3eb

Please sign in to comment.