From b486cce51ef1e86aaa1655d0de92b17fc420b623 Mon Sep 17 00:00:00 2001 From: libook Date: Tue, 4 Jul 2023 12:38:21 +0800 Subject: [PATCH] feat: filter ANSI color for shell --- 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 47c3d67c..ab04dc67 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();