From e87ee10f8b2350195c66d93168546057bf7ffefe Mon Sep 17 00:00:00 2001 From: Jason Croft Date: Thu, 25 Feb 2016 03:50:22 -0600 Subject: [PATCH] Set limit on command history length --- mininet/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mininet/cli.py b/mininet/cli.py index a7fab39..77ce26f 100644 --- a/mininet/cli.py +++ b/mininet/cli.py @@ -77,13 +77,15 @@ class CLI( Cmd ): return cls.readlineInited = True try: - from readline import read_history_file, write_history_file + from readline import ( read_history_file, write_history_file, + set_history_length ) except ImportError: pass else: history_path = os.path.expanduser( '~/.mininet_history' ) if os.path.isfile( history_path ): read_history_file( history_path ) + set_history_length( 1000 ) atexit.register( lambda: write_history_file( history_path ) ) def run( self ):