From f19d18350d1cc50e3bf25d72570b019e50e591f0 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 5 Oct 2017 22:41:51 +0530 Subject: [PATCH] mitop: fix overlong command lines corrupting the followign line --- examples/mitop.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/mitop.py b/examples/mitop.py index b54d1d69..07a937ef 100644 --- a/examples/mitop.py +++ b/examples/mitop.py @@ -92,7 +92,7 @@ class Painter(object): curses.endwin() def paint(self): - self.stdscr.clear() + self.stdscr.erase() self.stdscr.addstr(0, 0, time.ctime()) all_procs = [] @@ -116,7 +116,10 @@ class Painter(object): self.stdscr.attron(curses.A_BOLD) else: self.stdscr.attroff(curses.A_BOLD) - self.stdscr.addstr(2+i, 0, self.format % vars(proc)) + self.stdscr.addstr(2+i, 0, self.format % dict( + vars(proc), + command=proc.command[:self.width-36] + )) self.stdscr.refresh()