Skip to content

LogViewer doesn't handle ANSI "CSI Ps K" (Erase in Line) control character #101

@logonoff

Description

@logonoff

When you debug a node ( Compute -> Nodes -> SomeNode -> Terminal, or via CLI oc debug node/[nodeName] ) and you open a separate console window where you open up the spawned debug pods logs, the shell prompt (e.g sh-5.1#) is shown twice at the start of the logs.

This is not shown when oc logs is used because ANSI control characters are used to hide the first sh-5.1.

reproducing example:

import { LogViewer } from '@patternfly/react-log-viewer';

// shows "secret message"
export default () => (
  [LogViewer data="\x1b[0msecret message\r\x1b[K" /]
);

vs.

h1. shows nothing
echo -e "\x1b[0msecret message\r\x1b[K"

xref https://redhat.atlassian.net/browse/OCPBUGS-54247


Jira Issue: PF-3123

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions