kernel-rebase: enable interactive console tab completion

Quality of life change, completes both local and global symbols using a
completion function from the standard library (rlcompleter).

TEST=./; enter 'prin', press tab, should complete to 'print('

Change-Id: I801e32fb6a82043be45198527eef9b1cc45f51b1
Reviewed-by: Guenter Roeck <>
Tested-by: Kamil Koczurek <>
Commit-Queue: Kamil Koczurek <>
diff --git a/contrib/kernel-rebase/ b/contrib/kernel-rebase/
index 7fbce13..740e87f 100644
--- a/contrib/kernel-rebase/
+++ b/contrib/kernel-rebase/
@@ -12,6 +12,7 @@
 from datetime import datetime
 import os
 import readline
+import rlcompleter
 import sys
 import sh
@@ -60,6 +61,8 @@
         except FileNotFoundError:
+        readline.set_completer(rlcompleter.Completer(local).complete)
+        readline.parse_and_bind('tab: complete')
     def push(self, line):
         """temporarily subsistute a Logger() instance before forwarding the push() call