diff --git a/src/dlangui/platforms/console/consoleapp.d b/src/dlangui/platforms/console/consoleapp.d index d3891923..5d21b3a0 100644 --- a/src/dlangui/platforms/console/consoleapp.d +++ b/src/dlangui/platforms/console/consoleapp.d @@ -143,13 +143,14 @@ class ConsolePlatform : Platform { _drawBuf.fillRect(Rect(0, 0, w.width, w.height), w.backgroundColor); w.onDraw(_drawBuf); auto caretRect = w.caretRect; - if ((w is activeWindow) && !caretRect.empty) { + if ((w is activeWindow)) { if (!caretRect.empty) { _drawBuf.console.setCursor(caretRect.left, caretRect.top); _drawBuf.console.setCursorType(w.caretReplace ? ConsoleCursorType.Replace : ConsoleCursorType.Insert); } else { _drawBuf.console.setCursorType(ConsoleCursorType.Invisible); } + _drawBuf.console.setWindowCaption(w.windowCaption); } } } diff --git a/src/dlangui/platforms/console/dconsole.d b/src/dlangui/platforms/console/dconsole.d index 9544f095..c318db3e 100644 --- a/src/dlangui/platforms/console/dconsole.d +++ b/src/dlangui/platforms/console/dconsole.d @@ -485,6 +485,20 @@ class Console { } } + + private dstring _windowCaption; + void setWindowCaption(dstring str) { + if (_windowCaption == str) + return; + _windowCaption = str; + version(Windows) { + import std.utf; + SetConsoleTitle(toUTF16z(str)); + } else { + // TODO: ANSI terminal caption + } + } + private ConsoleCursorType _rawCursorType = ConsoleCursorType.Insert; protected void rawSetCursorType(ConsoleCursorType type) { if (_rawCursorType == type)