cb5cbb9241
Crashing on invalid input isn't the _worst_ behavior, but with a few tweaks we can make these scripts more-or-less noop in such cases. This is useful when running with -k/--keep-open since intermediate file states often contain garbage. (Ironically one of the precise problems littlefs is trying to solve.) Also added a special case to treemap.py/codemap.py to not output the canvas if there's nothing to show and height is implicit. Otherwise the history mode with -n/--lines ends up filled with blank lines. Note this makes -H1 subtly different from no -H/--height, with -H1 printing a blank line if there is nothing to show. The -H1 behavior may also be useful in niche cases where you want that part of the screen cleared. --- This was found while trying to run codemap.py -k -n5 during compilation. GCC writes object files incrementally, and this was breaking our script.