Skip to content

ColorFilter bugs #78

Description

@kayciwang

if r[pos] == '\033' && r[pos+1] == '[' {

  1. This line will panic with runtime error: index out of range if the last character in the rune buffer is \033 the escape sequence.
  2. The other potential bug is that not necessarily we need to escape the entire sequence up until "m", because it could be an invalid color code and the "m" is not part of the color code.

For the panic, need to check if \033 is the last character in the sequence, if it is, ignore it and return the sequence. For more robust solution we could use a buffer to buffer the ANSI color codes, but this might not guarantee correctness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions