Skip to content

Commit

Permalink
fix: strip ansi escape codes in container logs
Browse files Browse the repository at this point in the history
  • Loading branch information
omermecitoglu committed Jan 5, 2025
1 parent 1214094 commit ca6000c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/BashLogs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import useTheme from "@omer-x/bs-ui-kit/hooks/useTheme";
import SyntaxHighlighter from "react-syntax-highlighter";
import { atomOneDark, atomOneLight } from "react-syntax-highlighter/dist/esm/styles/hljs";
import stripAnsi from "strip-ansi";

type BashLogsProps = {
content: string,
Expand All @@ -18,7 +19,7 @@ const BashLogs = ({
style={theme === "dark" ? atomOneDark : atomOneLight}
wrapLongLines={wrap}
>
{content}
{stripAnsi(content)}
</SyntaxHighlighter>
);
};
Expand Down

0 comments on commit ca6000c

Please sign in to comment.