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

Cannot disable ANSI output #957

Closed
msaaltink opened this issue Dec 7, 2020 · 4 comments · Fixed by #960
Closed

Cannot disable ANSI output #957

msaaltink opened this issue Dec 7, 2020 · 4 comments · Fixed by #960

Comments

@msaaltink
Copy link
Contributor

Whether or not I have the --no-color option set, when I run SAW inside emacs using saw-script.el, every print_goal command's output is festooned with ANSI sequences around names. So I see things like ^[[0mPrelude.not^[[0m. I'm not sure if this is an error in saw-script, or in saw-script.el.

@brianhuffman
Copy link
Contributor

The ANSI output is supposed to be off by default; it should only be enabled if you use set_color true.

I actually had not been aware of the --no-color option before; according to CHANGES.md it says it's for printing the ASCII-art "SAW" logo without color codes. We should probably make the term pretty-printing code check the --no-color flag as well, and if present it should suppress the ANSI codes even if set_color is enabled.

@msaaltink
Copy link
Contributor Author

If I add set_color true I got codes other than [0m, but set_color false does not eliminate the ^[[0m codes I see in the output.

@brianhuffman
Copy link
Contributor

Ok, I just looked into this a bit more deeply. It is related to our recent switch to the prettyprinter library (GaloisInc/saw-core#106). I expected that using the "empty" annotation would result in no ANSI codes being output, but apparently that's not the case. I'll have to come up with another workaround for that.

@andreistefanescu
Copy link
Contributor

in the meantime, I use sed to clean up the output: sed -i 's/\x1b\[[0-9;]*m//g' out.txt

brianhuffman pushed a commit to GaloisInc/saw-core that referenced this issue Dec 7, 2020
Previously, even with color output disabled, the pretty printer
for terms was putting ANSI codes like `^[[0m` around all identifiers.
(See GaloisInc/saw-script#957.)
brianhuffman pushed a commit that referenced this issue Dec 8, 2020
…sent.

Also update saw-core to GaloisInc/saw-core#113 to prevent output of
ANSI escape sequences when `get_color` is disabled.

Fixes #957.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants