From d90a45514f9f681cd02d79da649dad0139e83aed Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Tue, 3 Feb 2015 22:02:29 -0800 Subject: [PATCH] node shell: remove unnecessary -m and unset HISTFILE Since we already disable job notification with +m, it doesn't make sense to set it in the original invocation! It's also annoying if all of the host commands end up overwriting your regular bash_history!! --- mininet/node.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mininet/node.py b/mininet/node.py index c602919..365fe57 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -125,11 +125,11 @@ class Node( object ): opts = '-cd' if mnopts is None else mnopts if self.inNamespace: opts += 'n' - # bash -m: enable job control, i: force interactive + # bash -i: force interactive # -s: pass $* to shell, and make process easy to find in ps # prompt is set to sentinel chr( 127 ) cmd = [ 'mnexec', opts, 'env', 'PS1=' + chr( 127 ), - 'bash', '--norc', '-mis', 'mininet:' + self.name ] + 'bash', '--norc', '-is', 'mininet:' + self.name ] # Spawn a shell subprocess in a pseudo-tty, to disable buffering # in the subprocess and insulate it from signals (e.g. SIGINT) # received by the parent @@ -157,7 +157,8 @@ class Node( object ): break self.pollOut.poll() self.waiting = False - self.cmd( 'stty -echo; set +m' ) + # +m: disable job control notification + self.cmd( 'unset HISTFILE; stty -echo; set +m' ) def mountPrivateDirs( self ): "mount private directories"