2017-04-04 21 views
2

我有以下代碼,它使用curses繪製一條帶有消息的小窗口。Curses背景顏色無法在iTerm2中使用TERM = xterm

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,我得到預期的輸出: enter image description here

TERM=xterm雖然,空間不是畫: enter image description here

如果我使用一個不同的字符爲背景,它正確地繪製。可能是什麼問題?

我正在使用Python 3和iTerm2 3.0。

回答