-
Notifications
You must be signed in to change notification settings - Fork 136
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
completely fails on win32/win64 #21
Comments
Very resourceful, finding a curses port. The Any research you care to do is welcome. |
After stumbling across this same error and performing a bit of research, I came across this recipe. Perhaps you could add it as a patch? |
There's a drop-in replacement fork for PDcurses: https://github.com/jmcb/python-pdcurses Anyway, I saw a good soluition by google-api-python-client to enable friendly locking cross-platform: http://code.google.com/p/google-api-python-client/source/detail?r=ac147884bf0c or even a nicer replacement using a module from grizzled-python: http://pydoc.net/grizzled-python/1.0.2/grizzled.io.filelock |
And http://pypi.python.org/pypi/UniCurses%20for%20Python/1.1 purports to be a PyPI packaging of PDCurses that I could depend on. Neat. Why do you mention the file-locking stuff? |
Because win32/win64 does not have ioctl as in |
google-api-python-client provides a workaround for |
Getting past the lack of ioctl isn't that big a deal, but PDCurses seems to completely stub out all of the "ti" functions. So while curses.A_BOLD exists, tigetstr(every_single_string) returns None to Python (see http://pdcurses.cvs.sourceforge.net/viewvc/pdcurses/PDCurses/pdcurses/terminfo.c?view=markup and scroll to line 167) My quick look over the blessings code makes me think that this is a bit of a show-stopper... |
+1 for this issue. Using Blessings 1.5.1.
|
Figured it's worth mentioning an alternative flavor of PDCurses, win32a. |
Flagging this Issue with the obvious Help Wanted; from someone who knows (a lot) more about windows terminals than we/I do, and could poke at a branch for this. What's more, if win needs certain, possibly elaborate, workarounds, ideally we introduce them without littering the core codebase with it. Fun! |
I found a solution for fcntl on SoF. |
The only way blessings will work on windows is with the PDCurses build mentioned by @shurane .. unfortunately, PDCurses is a non-op for all terminal capabilities and terminal types. So I have plans to do resolve this by proxying (only) the terminal capabilities of terminal type "ansi" (ecma-48), which roughly matches ansi.sys and the colorama and other sequence decoders to mscvrt packages. |
@jquast @shurane Apologies for my lack of knowledge here, I'm pretty unfamiliar with manually managing python dependencies, but I couldn't get your strategy to work. Combining what I found on the PDCurses for Windows ("win32a") website and the corresponding github fork's Windows readme, I:
And I'm presented with a bunch of new files ending in |
@erikrose , I am developing progress bar use blessing, and I got the same error for fcntl. I looked the source code, it is only used when getting the size of terminal. In the comments, you said
May I know why we need those number to update, or in which case it may run into problem ? In my current version, I just replace the code with
and it does not have problems in execution. Thanks in advance |
@HugoTian You'd need those numbers to update only if you planned to call tigetnum. What I meant by that comment is "Here is an alternative to tigetnum which is always up to date and doesn't need setupterm() to be called repeatedly." It's also possible that those routines update more frequently on Windows; you should test it. |
Sticking my reply to another bug here in case I'm wrong and someone can point it out:
|
Hi @erikrose , Actually, that's changed in Windows 10. See here: https://stackoverflow.com/questions/2048509/how-to-echo-with-different-colors-in-the-windows-command-line#38617204 Note the reply below the accepted answer that uses a very clever inline compilable .net script to achieve the same thing on OS versions earlier than Windows 10. Or, you could add a 3rd party dependency like https://github.com/jeremejevs/cmdcolor . |
Wow, that's great news! I'd be happy to require Windows 10 and up and let the passage of time solve the rest of the problem. I think that's the cleanest solution. So now this is a simple matter of getting the right (ANSI) terminal capabilities returned when on Windows. If things like |
As long as there's a "disable all colour codes" backward compatibility option, I'm +1 on the idea. |
To be clear, the current version of blessings remains incompatible with Windows, right? |
@natejgardner Correct. |
so bad, shedskin/shedskin#260 |
Did blessings ever work on Windows? If so, which version? blessings looks great and docs imply it works on Windows albeit without proper colors (colorama may fix) I'm writing a text adventure game with my 9yr old son. I was going to surprise him with color & UI. :( |
This issue is 7 years old but without any fix... Is there any update? You could maybe use some third-party packages for styling Windows' console. Also, Windows 10 now supports ANSI Escape Sequences. Can this be used to provide at least some functionalities? @TedHoward You can use Windows Subsystem for Linux or Docker to use Linux terminal on Windows. |
@filips123 That would work but seems like an awkward solution. Also I have a few Macs laying around I could use. colorama provides some colors, styling, and cursor navigation. Blessings would be a nice UI layer on top ... if it worked. I just found blessed which works on Windows (https://pypi.org/project/blessed/) |
The fork |
Worth a mention in the documentation alongside punting to colorama:
After installing curses on Windows from http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses :
If I have time I'll try and work out a proper port.
The text was updated successfully, but these errors were encountered: