aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/addons/command_history.py
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/addons/command_history.py')
-rw-r--r--mitmproxy/addons/command_history.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mitmproxy/addons/command_history.py b/mitmproxy/addons/command_history.py
index 2c1bf887..d5aaa928 100644
--- a/mitmproxy/addons/command_history.py
+++ b/mitmproxy/addons/command_history.py
@@ -27,7 +27,7 @@ class CommandHistory:
def running(self):
# FIXME: We have a weird bug where the contract for configure is not followed and it is never called with
# confdir or command_history as updated.
- self.configure("command_history")
+ self.configure("command_history") # pragma: no cover
def configure(self, updated):
if "command_history" in updated or "confdir" in updated:
@@ -36,9 +36,9 @@ class CommandHistory:
self.set_filter('')
def done(self):
- if ctx.options.command_history and len(self.history) > self.VACUUM_SIZE:
+ if ctx.options.command_history and len(self.history) >= self.VACUUM_SIZE:
# vacuum history so that it doesn't grow indefinitely.
- history_str = "\n".join(self.history[-self.VACUUM_SIZE / 2:]) + "\n"
+ history_str = "\n".join(self.history[-self.VACUUM_SIZE // 2:]) + "\n"
self.history_file.write_text(history_str)
@command.command("commands.history.add")