File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -666,6 +666,8 @@ def get_line(self):
666666 while True :
667667 key = self .get_key ()
668668 if self .p_key (key ) is None :
669+ if self .config .cli_trim_prompts and self .s .startswith (">>> " ):
670+ self .s = self .s [4 :]
669671 return self .s
670672
671673 def home (self , refresh = True ):
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ def loadini(struct, configfile):
9191 'yank_from_buffer' : 'C-y' },
9292 'cli' : {
9393 'suggestion_width' : 0.8 ,
94+ 'trim_prompts' : False ,
9495 },
9596 'gtk' : {
9697 'font' : 'monospace 10' ,
@@ -142,6 +143,8 @@ def loadini(struct, configfile):
142143
143144 struct .cli_suggestion_width = config .getfloat ('cli' ,
144145 'suggestion_width' )
146+ struct .cli_trim_prompts = config .getboolean ('cli' ,
147+ 'trim_prompts' )
145148
146149 struct .complete_magic_methods = config .getboolean ('general' ,
147150 'complete_magic_methods' )
Original file line number Diff line number Diff line change @@ -241,6 +241,12 @@ The width of the suggestion window in percent of the terminal width.
241241
242242.. versionadded :: 0.9.8
243243
244+ trim_prompts
245+ ^^^^^^^^^^^^
246+ Default: False
247+
248+ Trims lines starting with '>>> ' when set to True.
249+
244250GTK
245251---
246252This refers to the ``[gtk] `` section in your `$XDG_CONFIG_HOME/bpython/config ` file.
You can’t perform that action at this time.
0 commit comments