Skip to content

Commit

Permalink
fix: Fix ANSI color sequences escaping (#7211)
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Fillon <guillaume.fillon@auth0.com>
  • Loading branch information
zirkome committed Nov 15, 2021
1 parent e8a2f37 commit eb9a428
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export const WorkflowLogsViewer = ({workflow, nodeId, initialPodName, container,
.getContainerLogs(workflow, podName, nodeId, selectedContainer, grep, archived)
.map(e => (!podName ? e.podName + ': ' : '') + e.content + '\n')
// this next line highlights the search term in bold with a yellow background, white text
.map(x => x.replace(new RegExp(grep, 'g'), y => '\u001b[1m\u001b[43;1m\u001b[37m' + y + '\u001b[0m'))
.map(x => {
if (grep !== '') {
return x.replace(new RegExp(grep, 'g'), y => '\u001b[1m\u001b[43;1m\u001b[37m' + y + '\u001b[0m');
}
return x;
})
.publishReplay()
.refCount();
const subscription = source.subscribe(
Expand Down

0 comments on commit eb9a428

Please sign in to comment.