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:
183183                     Defaults to sys.stdout. 
184184        """ 
185185        # 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. 
187187        # These defaults can be overridden in calls to the console's or cmd2's print methods. 
188188        super ().__init__ (
189189            file = file ,
@@ -201,6 +201,22 @@ class Cmd2RichArgparseConsole(Cmd2BaseConsole):
201201    which conflicts with rich-argparse's explicit no_wrap and overflow settings. 
202202    """ 
203203
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+ 
204220
205221class  Cmd2ExceptionConsole (Cmd2BaseConsole ):
206222    """Rich console for printing exceptions. 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments