From d7f71b9097cf47a85e3ab5d7f3238a4f82f18b98 Mon Sep 17 00:00:00 2001 From: Daniel Li Date: Thu, 20 Jul 2023 23:38:53 +0800 Subject: [PATCH] fix: filter ANSI color for shell (#2529) * feat: filter ANSI color for shell * chore: fix formatting --------- Co-authored-by: Oleg Lobanov (cherry picked from commit 9bcfa900f904fe683c8d9085947f57932bfe22a0) --- frontend/src/components/Shell.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Shell.vue b/frontend/src/components/Shell.vue index 47c3d67c7a..dd5bf3191d 100644 --- a/frontend/src/components/Shell.vue +++ b/frontend/src/components/Shell.vue @@ -113,7 +113,10 @@ export default { this.scroll(); }, () => { - results.text = results.text.trimEnd(); + results.text = results.text + // eslint-disable-next-line no-control-regex + .replace(/\u001b\[[0-9;]+m/g, "") // Filter ANSI color for now + .trimEnd(); this.canInput = true; this.$refs.input.focus(); this.scroll();