diff --git a/kitty/complete.py b/kitty/complete.py index 2bee3b797..f925b90c5 100644 --- a/kitty/complete.py +++ b/kitty/complete.py @@ -79,8 +79,12 @@ class MatchGroup: def debug(*a: Any, **kw: Any) -> None: - kw['file'] = sys.stderr - print(*a, **kw) + from kittens.tui.loop import Debug + if not hasattr(debug, 'output'): + d = Debug() + d.fobj = sys.stderr.buffer # type: ignore + setattr(debug, 'output', d) + getattr(debug, 'output')(*a, **kw) class Delegate: