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/ ) 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.

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

xref https://issues.redhat.com/browse/OCPBUGS-54247

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions