[GH-ISSUE #225] ASCII color support #188

Open
opened 2026-02-26 05:31:33 +03:00 by kerem · 6 comments
Owner

Originally created by @ngoctnq on GitHub (Mar 10, 2020).
Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/225

Currently I'm piping a program's output into a text file and then let log.io track it. However, it gives [0M-type of characters in the stream and not format them (like it would have if I were using less -r). Is the support for this functionality?

Originally created by @ngoctnq on GitHub (Mar 10, 2020). Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/225 Currently I'm piping a program's output into a text file and then let `log.io` track it. However, it gives `[0M`-type of characters in the stream and not format them (like it would have if I were using `less -r`). Is the support for this functionality?
Author
Owner

@msmathers commented on GitHub (Mar 10, 2020):

This is not currently supported... I'll add this as a feature request. I'm not too familiar with all ASCII color escape codes, would implementing support for the following table be sufficient? https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

<!-- gh-comment-id:597098876 --> @msmathers commented on GitHub (Mar 10, 2020): This is not currently supported... I'll add this as a feature request. I'm not too familiar with all ASCII color escape codes, would implementing support for the following table be sufficient? https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
Author
Owner

@ngoctnq commented on GitHub (Mar 10, 2020):

I'd say that's sufficient. If we go with stuff like screen clearing, that'll open a huge can of worm.

<!-- gh-comment-id:597099455 --> @ngoctnq commented on GitHub (Mar 10, 2020): I'd say that's sufficient. If we go with stuff like screen clearing, that'll open a huge can of worm.
Author
Owner

@sik0vny commented on GitHub (May 10, 2020):

I'm also interested in coloring the output

<!-- gh-comment-id:626264172 --> @sik0vny commented on GitHub (May 10, 2020): I'm also interested in coloring the output
Author
Owner

@sguilly commented on GitHub (May 28, 2020):

Use : https://github.com/nteract/ansi-to-react in ScreenMessage

const ScreenMessage: React.FC = ({
message,
messageFilter
}) => {
return (


{messageFilter && _parseMessageParts(message, messageFilter).map((part, i) =>
<span key={i} className={part.highlight ? 'highlight' : ''}>

{part.text}


)}
{!messageFilter && {message}}

)
}

see : https://github.com/s3pweb/log.io/blob/master/ui/src/components/screens/index.tsx

<!-- gh-comment-id:635409573 --> @sguilly commented on GitHub (May 28, 2020): Use : https://github.com/nteract/ansi-to-react in ScreenMessage const ScreenMessage: React.FC<ScreenMessageProps> = ({ message, messageFilter }) => { return ( <div> {messageFilter && _parseMessageParts(message, messageFilter).map((part, i) => <span key={i} className={part.highlight ? 'highlight' : ''}> <Ansi> {part.text} </Ansi> </span> )} {!messageFilter && <Ansi>{message}</Ansi>} </div> ) } see : https://github.com/s3pweb/log.io/blob/master/ui/src/components/screens/index.tsx
Author
Owner

@imidoriya commented on GitHub (Oct 19, 2020):

@sguilly you should make this a pull request. Any instructions on how to use your changes? I got the main code working, but don't know how to add your edits. My experience is limited with node/npm.

<!-- gh-comment-id:711455199 --> @imidoriya commented on GitHub (Oct 19, 2020): @sguilly you should make this a pull request. Any instructions on how to use your changes? I got the main code working, but don't know how to add your edits. My experience is limited with node/npm.
Author
Owner

@yunnysunny commented on GitHub (Jan 1, 2021):

Use : https://github.com/nteract/ansi-to-react in ScreenMessage

const ScreenMessage: React.FC = ({
message,
messageFilter
}) => {
return (

{messageFilter && _parseMessageParts(message, messageFilter).map((part, i) =>
<span key={i} className={part.highlight ? 'highlight' : ''}>

{part.text}

)}
{!messageFilter && {message}}

)
}
see : https://github.com/s3pweb/log.io/blob/master/ui/src/components/screens/index.tsx

It looks good! Please pull a request.

<!-- gh-comment-id:753286633 --> @yunnysunny commented on GitHub (Jan 1, 2021): > Use : https://github.com/nteract/ansi-to-react in ScreenMessage > > const ScreenMessage: React.FC = ({ > message, > messageFilter > }) => { > return ( > > {messageFilter && _parseMessageParts(message, messageFilter).map((part, i) => > <span key={i} className={part.highlight ? 'highlight' : ''}> > > {part.text} > > > )} > {!messageFilter && {message}} > > ) > } > see : https://github.com/s3pweb/log.io/blob/master/ui/src/components/screens/index.tsx It looks good! Please pull a request.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/log.io-NarrativeScience-old#188
No description provided.