Skip to content

Commit

Permalink
Add more colors
Browse files Browse the repository at this point in the history
  • Loading branch information
breiler committed May 2, 2024
1 parent 002c9d6 commit 597e1ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/terminal/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ let timer: ReturnType<typeof setTimeout> | undefined = undefined;
const COLOR_RED = "\x1b[91m";
const COLOR_GREEN = "\x1b[92m";
const COLOR_GRAY = "\x1b[37m";
const COLOR_YELLOW = "\x1b[93m";

/**
* A function for writing the data to the terminal.
Expand All @@ -42,6 +43,8 @@ const handleTerminalInput = (data: ArrayBuffer, terminal: XTerminal) => {
console.log("Term " + buffer);
buffer = buffer.replace(/MSG:ERR/g, COLOR_RED + "$&" + COLOR_GRAY);
buffer = buffer.replace(/MSG:INFO/g, COLOR_GREEN + "$&" + COLOR_GRAY);
buffer = buffer.replace(/MSG:WARN/g, COLOR_YELLOW + "$&" + COLOR_GRAY);
buffer = buffer.replace(/MSG:DBG/g, COLOR_YELLOW + "$&" + COLOR_GRAY);
buffer = buffer.replace(
/<Alarm/g,
"<" + COLOR_RED + "Alarm" + COLOR_GRAY
Expand Down

0 comments on commit 597e1ff

Please sign in to comment.