def contents_changed(self, term):
c,r = term.get_cursor_position()
- text = self.get_text_range(self.getHistoryLen()-1,0,r,-1,lambda *w:True)
+ text = self.get_text_range(max(self.getHistoryLen()-1,0),0,r,-1,lambda *w:True)
#Remove annoying \n at the end
assert(text[-1] == "\n")
self.history += [l+"\n" for l in lines[:-1]]
self.history += [lines[-1]]
+ assert(r == self.getHistoryLen()-1)
+
def waitForNewline(self):
l = self.getHistoryLen()