【发布时间】:2017-04-04 18:31:41
【问题描述】:
我有以下代码使用curses 绘制带有消息的小窗口。
import curses
import time
screen = curses.initscr()
curses.start_color()
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)
window = curses.newwin(15, 60)
window.bkgd(' ', curses.color_pair(1))
window.addstr(7, 1, 'Hello')
window.refresh()
time.sleep(2)
curses.endwin()
我希望背景颜色为蓝色,但在 iTerm2 中的行为并不一致。使用TERM=screen,我得到了预期的输出:
如果我使用不同的字符作为背景,它会正确绘制。可能是什么问题?
我正在使用 Python 3 和 iTerm2 3.0。
【问题讨论】: