Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Curses/Blessings unsupported on windows #3

Open
ThomasFitconnect opened this issue Aug 10, 2015 · 4 comments
Open

Curses/Blessings unsupported on windows #3

ThomasFitconnect opened this issue Aug 10, 2015 · 4 comments

Comments

@ThomasFitconnect
Copy link

Krill crashes on windows.

The root cause of the crash is that curses is not on windows machines.

The library you are using for terminal manipulation (blessings) has an open issue on github for this here.

It looks like you are only using this to color/format text in the terminal. It may be worth looking into colorama which is cross platform.

If I have time I might try and implement this myself.

Traceback:

Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\krill.exe\__main__.py", line 5, in <module>
  File "C:\Python34\lib\site-packages\krill\krill.py", line 31, in <module>
    from blessings import Terminal
  File "C:\Python34\lib\site-packages\blessings\__init__.py", line 5, in <module>

    import curses
  File "C:\Python34\lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ImportError: No module named '_curses'

Other than this minor issue I really like you code :)

@p-e-w
Copy link
Owner

p-e-w commented Aug 12, 2015

Thank you for the input. I do not have access to a Windows machine so supporting Windows is not really on my agenda, but I hear there are proper terminal emulators for Windows too (e.g. one based on PuTTY) that have no problem with ANSI escape codes. Alternatively, Cygwin has a curses implementation that should work as well.

I don't quite understand why blessings requires curses in the first place though. What little terminal features it offers could easily be provided with raw escape sequences.

@brunston
Copy link

Alternately, could you add a flag which would disable curses color?

@p-e-w p-e-w mentioned this issue Sep 12, 2015
@waynew
Copy link

waynew commented Oct 5, 2015

AFAIK (having been looking at curses/blessings/urwid/etc lately), I suspect it's that curses wraps a lot of terminal functionality behind the scenes. As in, you could successfully use krill on a terminal that actually doesn't support colors, as curses wraps something like termcap and then will display the ansi sequences or not, depending. I could be wrong, though ;)

As another alternative to colorama, I think clint supports Windows... but I don't currently have a Windows box so I could be wrong about that one, too :P

@waynew
Copy link

waynew commented Oct 17, 2015

It looks like the Click library handles ANSI colors automagically. With an added bonus of making CLI parsing rather nice ;)

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

No branches or pull requests

4 participants