1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Change the "explain_i" tcl test command so that xterm color codes are only added if the output is actually a terminal.

FossilOrigin-Name: 559835e54e0715f2b4d207d056199a8268af739e
This commit is contained in:
dan
2014-03-03 16:48:47 +00:00
parent fbf0f0e1f6
commit dea63f24e1
3 changed files with 18 additions and 11 deletions

View File

@ -1062,10 +1062,17 @@ proc explain_i {sql {db db}} {
# Blue: Opcodes that reposition or seek a cursor.
# Green: The ResultRow opcode.
#
set R "\033\[31;1m" ;# Red fg
set G "\033\[32;1m" ;# Green fg
set B "\033\[34;1m" ;# Red fg
set D "\033\[39;0m" ;# Default fg
if { [catch {fconfigure stdout -mode}]==0 } {
set R "\033\[31;1m" ;# Red fg
set G "\033\[32;1m" ;# Green fg
set B "\033\[34;1m" ;# Red fg
set D "\033\[39;0m" ;# Default fg
} else {
set R ""
set G ""
set B ""
set D ""
}
foreach opcode {
Seek SeekGe SeekGt SeekLe SeekLt NotFound Last Rewind
NoConflict Next Prev VNext VPrev VFilter