Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
b36fe2cb
Commit
b36fe2cb
authored
Dec 10, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache outcome of checking to see if host supports ANSI output
Closes gh-4510
parent
8dc3b71c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
AnsiOutput.java
...c/main/java/org/springframework/boot/ansi/AnsiOutput.java
+11
-2
No files found.
spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java
View file @
b36fe2cb
...
@@ -30,6 +30,8 @@ public abstract class AnsiOutput {
...
@@ -30,6 +30,8 @@ public abstract class AnsiOutput {
private
static
Enabled
enabled
=
Enabled
.
DETECT
;
private
static
Enabled
enabled
=
Enabled
.
DETECT
;
private
static
Boolean
ansiCapable
;
private
static
final
String
OPERATING_SYSTEM_NAME
=
System
.
getProperty
(
"os.name"
)
private
static
final
String
OPERATING_SYSTEM_NAME
=
System
.
getProperty
(
"os.name"
)
.
toLowerCase
();
.
toLowerCase
();
...
@@ -108,12 +110,19 @@ public abstract class AnsiOutput {
...
@@ -108,12 +110,19 @@ public abstract class AnsiOutput {
private
static
boolean
isEnabled
()
{
private
static
boolean
isEnabled
()
{
if
(
enabled
==
Enabled
.
DETECT
)
{
if
(
enabled
==
Enabled
.
DETECT
)
{
return
detectIf
Enabled
();
return
detectIf
AnsiCapable
();
}
}
return
enabled
==
Enabled
.
ALWAYS
;
return
enabled
==
Enabled
.
ALWAYS
;
}
}
private
static
boolean
detectIfEnabled
()
{
private
static
boolean
detectIfAnsiCapable
()
{
if
(
ansiCapable
==
null
)
{
ansiCapable
=
doDetectIfAnsiCapable
();
}
return
ansiCapable
;
}
private
static
boolean
doDetectIfAnsiCapable
()
{
try
{
try
{
if
(
System
.
console
()
==
null
)
{
if
(
System
.
console
()
==
null
)
{
return
false
;
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment