【问题标题】:Curses background color not working in iTerm2 with TERM=xterm使用 TERM=xterm 诅咒背景颜色在 iTerm2 中不起作用
【发布时间】: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,我得到了预期的输出:

TERM=xterm 时,不会绘制空格:

如果我使用不同的字符作为背景,它会正确绘制。可能是什么问题?

我正在使用 Python 3 和 iTerm2 3.0。

【问题讨论】:

    标签: python curses iterm2


    【解决方案1】:

    问题在于 tmux 不支持 xterm 终端描述中假设的“背景颜色擦除”功能。

    进一步阅读:

    【讨论】:

      猜你喜欢
      • 2013-10-26
      • 2015-06-15
      • 2011-11-11
      • 2011-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-09
      • 1970-01-01
      相关资源
      最近更新 更多