zephyrproject-rtos / windows-curses

Windows Curses Python module
https://pypi.org/project/windows-curses/
Other
171 stars 30 forks source link

tigetstr and tparam return None. #49

Open ahaoboy opened 11 months ago

ahaoboy commented 11 months ago

win11 + Windows terminal

import curses

curses.setupterm()

# error: python ./tmp.py' terminated by signal SIGSEGV (Address boundary error)
# print(curses.initscr())
# print(curses.termname())

def get_tparm(key):
    val = None
    key = curses.tigetstr(key)
    if key:
        val = curses.tparm(key)
    if val:
        val = val.decode("utf-8")
    return val

# expect: ('\x1b(B\x1b[m', '\x1b[1m', '\x1b[4m')
# actual: (None, None, None)
print((get_tparm("sgr0"), get_tparm("bold"), get_tparm("smul")))