Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tigetstr and tparam return None. #49

Open
ahaoboy opened this issue Nov 20, 2023 · 0 comments · Fixed by fish-shell/fish-shell#10111
Open

tigetstr and tparam return None. #49

ahaoboy opened this issue Nov 20, 2023 · 0 comments · Fixed by fish-shell/fish-shell#10111
Labels
bug Something isn't working

Comments

@ahaoboy
Copy link

ahaoboy commented Nov 20, 2023

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")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants