Skip to content

Commit

Permalink
Disable get_color true when --no-color command-line option is pre…
Browse files Browse the repository at this point in the history
…sent.

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

Fixes #957.
  • Loading branch information
Brian Huffman committed Dec 8, 2020
1 parent 9208c87 commit 3514dac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/saw-core
5 changes: 4 additions & 1 deletion src/SAWScript/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,10 @@ set_base b = do
set_color :: Bool -> TopLevel ()
set_color b = do
rw <- getTopLevelRW
putTopLevelRW rw { rwPPOpts = (rwPPOpts rw) { ppOptsColor = b } }
opts <- getOptions
-- Keep color disabled if `--no-color` command-line option is present
let b' = b && useColor opts
putTopLevelRW rw { rwPPOpts = (rwPPOpts rw) { ppOptsColor = b' } }

print_value :: Value -> TopLevel ()
print_value (VString s) = printOutLnTop Info s
Expand Down

0 comments on commit 3514dac

Please sign in to comment.