-
Notifications
You must be signed in to change notification settings - Fork 128
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
modd escaping values in terminal (configuration struct) #19
Comments
Hey there. This sounds like an issue that's been fixed in master - could you please confirm that you still see this with a current checkout? |
Hi @cortesi! Just looked at the issue and it seems to be only happening with the logrus library. Its because it's not identifying package logrus
import (
"os"
"golang.org/x/sys/unix"
)
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal() bool {
_, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
return err == nil
} Is this a expected behavior? (i.e. modd not be identified as a valid terminal) Thanks! |
Ah, this clarifies things. I looked at ways of pretending to be a terminal to invoked processes, and it turns out it's not possible without a lot of fragile machinery and portability paraphernalia. Most pieces of software give you some way to over-ride the terminal detection - a quick read of the logrus code seems to show that ForceColor might do what you want (despite the fact that the escaped values here are not ANSI colour codes). |
@brenol commented on Mon Mar 28 2016
Hello!
I have a JSON that is shown in the terminal with MarshalIndent and it's not looking good with modd, because of escaping. It's shown because its application configuration, for instance:
I looked at the cli --help and I did not find any solution: Is there any way to disable escaping nowadays?
Thanks!
The text was updated successfully, but these errors were encountered: