Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/js/tabs/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
$('.tab-cli textarea').val(text);
}

TABS.cli.read = function (readInfo) {

Check warning on line 388 in src/js/tabs/cli.js

View workflow job for this annotation

GitHub Actions / build (macos-26, macos-arm64)

Function has a complexity of 24. Maximum allowed is 20

Check warning on line 388 in src/js/tabs/cli.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64)

Function has a complexity of 24. Maximum allowed is 20

Check warning on line 388 in src/js/tabs/cli.js

View workflow job for this annotation

GitHub Actions / build (macos-26-intel, macos-x86_64)

Function has a complexity of 24. Maximum allowed is 20

Check warning on line 388 in src/js/tabs/cli.js

View workflow job for this annotation

GitHub Actions / build (windows-2022, windows-x64, x64)

Function has a complexity of 24. Maximum allowed is 20

Check warning on line 388 in src/js/tabs/cli.js

View workflow job for this annotation

GitHub Actions / build (windows-2022, windows-ia32, ia32)

Function has a complexity of 24. Maximum allowed is 20
/* Some info about handling line feeds and carriage return

line feed = LF = \n = 0x0A = 10
Expand All @@ -404,9 +404,8 @@
const currentChar = String.fromCharCode(data[i]);

if (!CONFIGURATOR.cliValid) {
// try to catch part of valid CLI enter message
// Accumulate silently; MSP garbage before welcome message is not shown
validateText += currentChar;
writeToOutput(currentChar);
continue;
}

Expand Down Expand Up @@ -466,6 +465,19 @@
if (!CONFIGURATOR.cliValid && validateText.indexOf('CLI') !== -1) {
GUI.log(i18n.getMessage('cliEnter'));
CONFIGURATOR.cliValid = true;
// Display only from 'Entering CLI Mode' onwards; MSP garbage before it is discarded
const cliMsgStart = validateText.indexOf('Entering CLI');
if (cliMsgStart >= 0) {
const welcomeText = validateText.substring(cliMsgStart);
const lines = welcomeText.split(/\r?\n|\r/);
for (let j = 0; j < lines.length; j++) {
if (j < lines.length - 1) {
writeLineToOutput(lines[j]);
} else if (lines[j].length > 0) {
writeToOutput(lines[j]); // prompt line — no trailing <br>
}
}
}
// begin output history with the prompt (last line of welcome message)
// this is to match the content of the history with what the user sees on this tab
const lastLine = validateText.split("\n").pop();
Expand Down
Loading