Merge pull request #373 from AllanChain/master
Add better Windows color support using colorama
This commit is contained in:
commit
55518edb2e
8
buku
8
buku
@ -4323,7 +4323,9 @@ def read_in(msg):
|
|||||||
disable_sigint_handler()
|
disable_sigint_handler()
|
||||||
message = None
|
message = None
|
||||||
try:
|
try:
|
||||||
message = input(msg)
|
# Delibrately dong this to better support Windows colorizing
|
||||||
|
print(msg, end='')
|
||||||
|
message = input()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('Interrupted.')
|
print('Interrupted.')
|
||||||
|
|
||||||
@ -4853,6 +4855,10 @@ POSITIONAL ARGUMENTS:
|
|||||||
# only ConEmu is supported. If the user does not use ConEmu, colors are
|
# only ConEmu is supported. If the user does not use ConEmu, colors are
|
||||||
# disabled unless --colors or %BUKU_COLORS% is specified.
|
# disabled unless --colors or %BUKU_COLORS% is specified.
|
||||||
if sys.platform == 'win32' and os.environ.get('ConemuDir') is None:
|
if sys.platform == 'win32' and os.environ.get('ConemuDir') is None:
|
||||||
|
try:
|
||||||
|
import colorama
|
||||||
|
colorama.init()
|
||||||
|
except ImportError:
|
||||||
if args.colorstr is None and colorstr_env is not None:
|
if args.colorstr is None and colorstr_env is not None:
|
||||||
args.nc = True
|
args.nc = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user