- #Remove the incomplete line
- if self.getHistoryLen()>0 and (len(self.history[-1])==0 or self.history[-1]!='\n') :
- del self.history[-1]
+ c,r = term.get_cursor_position()
+ text = self.get_text_range(self.lastr,self.lastc,r,c-1,lambda *w:True)
+ self.lastc, self.lastr = c,r