Skip to content

Commit 14da675

Browse files
committed
Really merge the changes from ingrid.
2 parents a82e6ef + 7908d85 commit 14da675

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

bpython/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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):

bpython/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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')

doc/sphinx/source/configuration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
244250
GTK
245251
---
246252
This refers to the ``[gtk]`` section in your `$XDG_CONFIG_HOME/bpython/config` file.

0 commit comments

Comments
 (0)