Disabling telemetry for mongo shell (#2195)

* Disabling telemetry for mongo shell

* fix formatting issues

* removed empty spaces from terminal and segregated disableTelemetry command
This commit is contained in:
BChoudhury-ms
2025-07-31 10:03:09 +05:30
committed by GitHub
parent e3815734db
commit 870863a723
11 changed files with 59 additions and 28 deletions

View File

@@ -135,11 +135,13 @@ export class AttachAddon implements ITerminalAddon {
}
if (this._allowTerminalWrite) {
const updatedData = this._shellHandler?.updateTerminalData(data) ?? data;
const suppressedData = this._shellHandler?.getTerminalSuppressedData();
const hasSuppressedData = suppressedData && suppressedData.length > 0;
if (!hasSuppressedData || !data.includes(suppressedData)) {
terminal.write(data);
const shouldNotWrite = suppressedData.filter(Boolean).some((item) => updatedData.includes(item));
if (!shouldNotWrite) {
terminal.write(updatedData);
}
}