Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::legacy::VirtualTerminal Struct Reference

Enable VT interpretation on the process's existing standard output. This stateless compatibility utility neither changes input mode nor opens a console. It does not restore output mode; use the retained Application for an owned terminal lifetime. More...

#include <legacy.hpp>

Static Public Member Functions

static std::expected< void, TerminalError > tryEnable () noexcept
 Checked form of the historical output-mode switch. On Windows, preserve other mode bits and enable ENABLE_PROCESSED_OUTPUT and ENABLE_VIRTUAL_TERMINAL_PROCESSING. Calls must be serialized with other changes to the same console mode. A redirected Windows stdout is rejected. On non-Windows platforms this is a successful no-op, matching the old helper; it does not detect ANSI capabilities.
static bool enable () noexcept
 Historical bool form, without retaining or printing an error.

Detailed Description

Enable VT interpretation on the process's existing standard output. This stateless compatibility utility neither changes input mode nor opens a console. It does not restore output mode; use the retained Application for an owned terminal lifetime.

Member Function Documentation

◆ enable()

bool portals::legacy::VirtualTerminal::enable ( )
staticnoexcept

Historical bool form, without retaining or printing an error.

Returns
True on success; false on a Windows output handle or console mode failure.

◆ tryEnable()

std::expected< void, TerminalError > portals::legacy::VirtualTerminal::tryEnable ( )
staticnoexcept

Checked form of the historical output-mode switch. On Windows, preserve other mode bits and enable ENABLE_PROCESSED_OUTPUT and ENABLE_VIRTUAL_TERMINAL_PROCESSING. Calls must be serialized with other changes to the same console mode. A redirected Windows stdout is rejected. On non-Windows platforms this is a successful no-op, matching the old helper; it does not detect ANSI capabilities.

Returns
Success, INVALID_OPTIONS with native_code zero for an absent stdout, or SYSTEM with the original Windows error code when a platform call fails.

The documentation for this struct was generated from the following file: