fix: filter ANSI color for shell (#2529)

* feat: filter ANSI color for shell

* chore: fix formatting

---------

Co-authored-by: Oleg Lobanov <oleg.lobanov@bitvavo.com>
pull/2559/head
Daniel Li 2023-07-20 23:38:53 +08:00 committed by GitHub
parent c2f1423c02
commit 9bcfa900f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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();