How to disable colors? #753
Comments
You mean "color bar"? Open your configuration file in .config and use |
No, he means the escape codes that format the text. Neofetch currently doesn't have an option to do this and I'm not sure if I'll add this feature since Neofetch wasn't intended to be piped into other commands. If you'd like to use some info from Neofetch I'd instead suggest looking into the source code to find the file or system command that displays the information you'd like to pipe. |
The most frequent thing that I use Neofetch for is filling in the "System Information" section in an issue report. So I run |
Maybe this would suffice for your usecase?
`neofetch|sed 's/\x1B\[[0-9;]*m//g'`
Using this, we would not need to modify neofetch.
|
Well, that would technically work, but it seems a little bit of an excessively hacky workaround to me. I could certainly put it in an alias, though. Thanks! |
Actually, I take it back. Before, it looked like this:
Now, it looks like this:
So some of the escape codes are gone, but not all of them. |
Those sequences are not generated by neofetch:
Do you have a wrapper in there that uses ncurses? Looks alot like curses output to me. Updated sed line would be like |
They are generated by neofetch.
…On Mon, 26 Jun 2017 at 2:38 am, Lain ***@***.***> wrote:
Those sequences are not generated by neofetch
<https://github.com/dylanaraps/neofetch/blob/master/neofetch#L3561>:
color() {
case "$1" in
[0-6]) printf "%b" "${reset}\033[3${1}m" ;;
7 | "fg") printf "%b" "\033[37m${reset}" ;;
*) printf "%b" "\033[38;5;${1}m" ;;
esac
}
Do you have a wrapper in there that uses ncurses? Looks alot like curses
output to me.
Updated sed line would be like neofetch|sed 's/\x1B\[[0-9;\?]*[a-zA-Z]//g'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#753 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGfAa1WCMyLvP_VmXjK10X8lgrpmub17ks5sHo0bgaJpZM4N-0O->
.
|
Ah i see. The updated sed line should work anyways. |
Judging by the output, it looks like things are no longer aligned, presumably since the alignment is done using escape codes. I can see how it would be difficult to add streaming support to Neofetch—but as a workaround, is there a way of running a command in a pseudo-tty and then copying the contents of the tty? That would really be what I want. (But the sed command does work in stripping out the escape codes; thanks!)
|
You can now disable colors in Run neofetch with |
Nice! But there are still some escape codes at the bottom:
gives me
|
Try this: |
It works great, thanks.
I'm slightly bothered by the extra blank lines at the bottom, but I can live with it. They're easy to trim off with a process substitution, anyway. |
@konimex I'm not sure, but shouldn't |
I totally forgot about that. My bad. The color blocks have been disabled. I'm still not sure about whether we should disable |
Yes, I think we should disable the line breaks. Edit: Done |
Description
I would like to pipe the output of
neofetch
into another command, but cannot figure out how to disable the ASCII escape codes that litter the output. I did not see any options inman neofetch
that appeared to be relevant.Neofetch version
3.1.0
Config file
None
The text was updated successfully, but these errors were encountered: