test display_on_terminal toggle, fix a bug in rect to support math_coords