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

fully support the curses module #8

Open
williamstein opened this issue Dec 8, 2022 · 2 comments
Open

fully support the curses module #8

williamstein opened this issue Dec 8, 2022 · 2 comments

Comments

@williamstein
Copy link
Contributor

I've been putting a ton of work into supporting curses in Python on the web, but it's not quite there.
I still don't have it fully done. If you go to https://cowasm.sh/ and type "rogue" or "hanoi" you
can see some games running using curses purely in the browser.

If in cowasm.org you try

>>> import curses
>>> curses.initscr()

there's a bunch of errors involving my termcap file parsing. I haven't got around to solving that problem yet, but I'm sure I will, since I won't fully old-school ipython support, and also the ability to quickly run a little vim session from python or cowasm.sh, and I'm almost there.

Anyway, this ticket is about figuring this out. Basically all the examples that come with curses work, but third party stuff mostly doesn't. It's probably just one little tiny detail somewhere to fix this, but figuring out what that detail is...

@martin12333
Copy link

martin12333 commented Jan 16, 2023

I am studying this topic now.

After the error messages,


>>> curses.initscr()
Name collision 'xterm-new' between
        xf|xterm-new|modern xterm:,
and     xf|xterm-new|modern xterm:,
...now  modern xterm:,
Cannot remove alias 'modern xterm:,'

........

Name collision 'xterm+kbs' between
        xterm+kbs|fragment for backspace key:,
and     xterm+kbs|fragment for backspace key:,
...now  fragment for backspace key:,
Cannot remove alias 'fragment for backspace key:,'


there is

<_curses.window object at 0xd7f3d0>

So I tried

w=curses.initscr()
w.getch(  )  # works

I plan to try some Python-curses examples and demos.

@williamstein
Copy link
Contributor Author

Thanks. I don't understand yet why curses fails in some cases, but all the examples that come with ncurses itself (such as hanoi) do work. If you find out anything, please post!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants