File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ def __init__(self, file: IO[str] | None = None) -> None:
183
183
Defaults to sys.stdout.
184
184
"""
185
185
# This console is configured for general-purpose printing. It enables soft wrap
186
- # and disables Rich's automatic processing for markup, emoji, and highlighting.
186
+ # and disables Rich's automatic detection for markup, emoji, and highlighting.
187
187
# These defaults can be overridden in calls to the console's or cmd2's print methods.
188
188
super ().__init__ (
189
189
file = file ,
@@ -201,6 +201,22 @@ class Cmd2RichArgparseConsole(Cmd2BaseConsole):
201
201
which conflicts with rich-argparse's explicit no_wrap and overflow settings.
202
202
"""
203
203
204
+ def __init__ (self , file : IO [str ] | None = None ) -> None :
205
+ """Cmd2RichArgparseConsole initializer.
206
+
207
+ :param file: optional file object where the console should write to.
208
+ Defaults to sys.stdout.
209
+ """
210
+ # Disable Rich's automatic detection for markup, emoji, and highlighting.
211
+ # rich-argparse does markup and highlighting without involving the console
212
+ # so these won't affect its internal functionality.
213
+ super ().__init__ (
214
+ file = file ,
215
+ markup = False ,
216
+ emoji = False ,
217
+ highlight = False ,
218
+ )
219
+
204
220
205
221
class Cmd2ExceptionConsole (Cmd2BaseConsole ):
206
222
"""Rich console for printing exceptions.
You can’t perform that action at this time.
0 commit comments