From 66662457f7e6cfc95de535503aa1f4b088822d2f Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 10 Jun 2008 13:47:22 +0200 Subject: [PATCH] fixing bug, when getting text from terminal: started at line -1 --- DbgTerminal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DbgTerminal.py b/DbgTerminal.py index 11eaf5c..e9a706f 100644 --- a/DbgTerminal.py +++ b/DbgTerminal.py @@ -59,7 +59,7 @@ class DbgTerminal (vte.Terminal): 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") @@ -76,6 +76,8 @@ class DbgTerminal (vte.Terminal): self.history += [l+"\n" for l in lines[:-1]] self.history += [lines[-1]] + assert(r == self.getHistoryLen()-1) + def waitForNewline(self): l = self.getHistoryLen() -- 2.39.5