Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASCII color support #225

Open
ngoctnq opened this issue Mar 10, 2020 · 6 comments
Open

ASCII color support #225

ngoctnq opened this issue Mar 10, 2020 · 6 comments

Comments

@ngoctnq
Copy link

ngoctnq commented Mar 10, 2020

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?

@msmathers
Copy link
Collaborator

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

@ngoctnq
Copy link
Author

ngoctnq commented 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.

@sik0vny
Copy link

sik0vny commented May 10, 2020

I'm also interested in coloring the output

@sguilly
Copy link

sguilly commented 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

@imidoriya
Copy link

imidoriya commented 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.

@yunnysunny
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants