Skip to content

Conversation

@MHendricks
Copy link
Member

@MHendricks MHendricks commented Dec 2, 2025

Rework the ConsolePrEdit class into a base classe and OutputConsole. OutputConsole can be used in tools and UI's to show output from any combination of stdout, stderr, python logging and raised tracebacks. You can use multiple of them at once and close and open them without affecting the main ConsolePrEdit.

Other improvements:

  • If PrEditor excepthooks fail it will now write the output to sys.__stderr__ so you can debug problems with PrEditor.
  • Support for PyQt in QtDesigner.
  • You can now insert separators into the consoles.
  • Improve text encoding detection and handling. Now assumes utf-8 unless that generates errors.

sublime_text_XlnzL2Re74

Checklist

  • I have read the CONTRIBUTING.md document
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation regarding my changes where necessary
  • Any pre-existing tests continue to pass
  • Additional tests were made covering my changes

Types of Changes

  • Bugfix (change that fixes an issue)
  • New Feature (change that adds functionality)
  • Documentation Update (if none of the other choices apply)

This helps when developing for the stream or console classes if you
cause an exception you might get no traceback printed to debug otherwise.
Also ensure that it writes unix newlines on windows
Restore StreamHandlerHelper removed in previous commit by moving it
into the more appropriate location of stream.install_to_std.
- This allows them to write their messages even if they wouldn't normally.
- Also remove legacy unused outputPipe. Instead add a callback to preditor.active.
This prevents all instances of the class sharing the same variable if
modified without using the setter.
- Consolidate truncate code under preditor.utils.Truncate.
- Move result printing into the Console class inside executeString.
MHendricks and others added 12 commits December 3, 2025 18:39
Instead of stdout/err redirection. This can be configured using QtDesigner.
This improves the QtDesigner plugin behavior
This logs the inputs and return of the decorated function
This prevents cases where the hand cursor override gets stuck on if the
mouse is quickly moved to another widget. It also seems to be processed faster.
1. Assume its encoded as utf-8 unless that causes an encoding error
2. Switch from chardet to charset-normalizer for encoding detection if otherwise detected

Add a testing framework to verify that character encoding is resolved correctly.
@MHendricks MHendricks force-pushed the mikeh/console_split branch 2 times, most recently from 4c6758f to 36d5c15 Compare December 5, 2025 21:05
@MHendricks MHendricks merged commit 44ec69d into main2.0 Dec 5, 2025
17 checks passed
@MHendricks MHendricks deleted the mikeh/console_split branch December 5, 2025 22:09
@MHendricks MHendricks mentioned this pull request Dec 5, 2025
9 tasks
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

Successfully merging this pull request may close these issues.

3 participants