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

Fix bold text style spilling after help info on Mac terminal #257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def help(self, use_colours = None):
if use_colours is None:
use_colours = sys.stdout.isatty()

print(('\033[1m%s\033[21m %s %s' if use_colours else '%s %s %s') % (self.__program, '-' if self.linuxvt else '—', self.__description))
print(('\033[1m%s\033[22m %s %s' if use_colours else '%s %s %s') % (self.__program, '-' if self.linuxvt else '—', self.__description))
print()
if self.__longdescription is not None:
desc = self.__longdescription
Expand All @@ -265,7 +265,7 @@ def help(self, use_colours = None):
print(desc)
print()

print('\033[1mUSAGE:\033[21m' if use_colours else 'USAGE:', end='')
print('\033[1mUSAGE:\033[22m' if use_colours else 'USAGE:', end='')
first = True
for line in self.__usage.split('\n'):
if first:
Expand All @@ -291,7 +291,7 @@ def help(self, use_colours = None):
maxfirstlen.append(first)
maxfirstlen = len(max(maxfirstlen, key = len))

print('\033[1mSYNOPSIS:\033[21m' if use_colours else 'SYNOPSIS')
print('\033[1mSYNOPSIS:\033[22m' if use_colours else 'SYNOPSIS')
(lines, lens) = ([], [])
for opt in self.__arguments:
opt_type = opt[0]
Expand Down Expand Up @@ -337,7 +337,7 @@ def help(self, use_colours = None):
for line in opt_help.split('\n'):
if first:
first = False
print('%s' % (line), end='\033[21;39m\n' if use_colours else '\n')
print('%s' % (line), end='\033[22;39m\n' if use_colours else '\n')
else:
print(('%s\033[%sm%s\033[39m' if use_colours else '%s%s%s') % (' ' * col, colour, line))
index += 1
Expand Down