Open jskm opened 6 years ago
Hi @jskm,
Thanks a lot for pointing this out! This should fix it: https://github.com/jonathanslenders/python-prompt-toolkit/commit/cf7515e27ce507ea4aa62d2da0397cb9e8595b85 Could you try again?
Is Application.run(set_exception_handler=True) working as intended? According to the docs:
Yes, this should work and is actually very helpful. Not so much in case of bugs like this, but if there is a bug in an key handler for instance, then this will display the exception, wait for the user to press ENTER, and go on. This is super useful for full screen applications. But of course, if there is a bug in the key input like here, it doesn't help.
Yes, it seems fine now. The examples are working well under Cmder. The Windows 7 console host (cmd/Powershell) seems unusable though, as nearly all of the examples I've tried display incorrectly, with black text on a black background and layout issues. I don't know whether you're intending to support that. I haven't been able to try it on Windows 10 yet.
Hi @jskm,
Thanks for pointing this out. For Windows 10 (with vt100 support) it used to work fine, but for older versions, there was indeed a bug. This should fix it: https://github.com/jonathanslenders/python-prompt-toolkit/commit/270142de5d9dccfe4902c78a84c975c2e5718b74 Can you try again?
It looks okay. I've tried various examples and apart from color palette and formatting limitations, the prompts are readable.
The only remaining issue I see is related to the code page and font used in the console. The Frame widget in particular breaks under code page 932. I took some screenshots using examples/full-screen/buttons.py.
Running the program with code page 932 creates this mess:
It looks like the frame is trying to draw double its actual width, and this only happens in the area covered by the Frame widget. Is this related to fullwidth/halfwidth sizes for CJK characters?
The frame is sized appropriately under code page 437, but another problem appears when choosing Consolas or Lucida Console (the only TrueType options available) for the console font:
This image shows Consolas and was taken after hitting Enter a few times to resize the box. A similar thing happens in other examples, such as with menu dropdowns and block selections in text-editor.py.
I have to choose "Raster Fonts" with code page 437 to avoid glitches.
I don't know what ConEmu is doing but it has no problems even with Consolas and chcp showing code page 932.
Hi @jskm, thanks for sharing! I'm not sure what's going on, but I'll see if I can reproduce and fix this on Windows 7.
When trying to run the example programs under examples/full_screen, I get an endless stream of exceptions as follows:
It looks like this error only happens on Windows. application.py#L489 calls read_keys() on a Win32Input, which returns a generator.
Is Application.run(set_exception_handler=True) working as intended? According to the docs:
In this case, there was an infinite loop that did not wait and couldn't be broken without closing the console.