From 40992470584439cca6049afa0d6ffca9b3210e63 Mon Sep 17 00:00:00 2001 From: Mattias Ugelvik Date: Sun, 22 Mar 2015 22:17:12 +0100 Subject: [PATCH] `lstrip` the first line of shell input --- xonsh/shell.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xonsh/shell.py b/xonsh/shell.py index bcb873331..dcf70e427 100644 --- a/xonsh/shell.py +++ b/xonsh/shell.py @@ -110,6 +110,9 @@ class Shell(Cmd): """Overridden to no-op.""" return '', line, line + def precmd(self, line): + return line if self.need_more_lines else line.lstrip() + def default(self, line): """Implements code execution.""" line = line if line.endswith('\n') else line + '\n'