Windows Console
Windows Console is a GUI application for running console applications in Windows. Windows Console is used for running text-based programs such as operating system shells, utilities and some, generally older, applications.
Windows Terminal was introduced in Windows 10 as a replacement for Windows Console. In 2019, the console host was open-sourced under the MIT License, alongside Windows Terminal.
Use
Full-screen mode
Image:Windows PowerShell 1.0 PD.png|thumb|right|Windows PowerShell on Windows VistaImage:GNU Midnight Commander 4.1.36 Windows Vista.png|thumb|right|Midnight Commander using box-drawing characters
Windows Console runs in either window or full-screen mode. The mode can be toggled by pressing.
In window mode, the console writes text in a window and uses an operating system's font rendering. In this mode, an application's user interaction is controlled by the windowing system, analogous to X Window System applications such as xterm.
In Windows XP and earlier, the full-screen console uses a hardware text mode and uploads a raster font to the video adapter, analogous to a text-based system console. This early full-screen mode only supports VGA-compatible text modes, giving it a maximum character resolution of 80 columns by 28 rows. This mode was removed in Windows Vista, although until Windows 8, it was possible to circumvent this issue by installing a Windows XP display driver.
Windows 10 features a full-screen mode once again. The implementation uses the native Windows rendering subsystem instead of the text mode, and supports rows and columns to fill the screen.
Programmatic access
A program may programmatically interact with its host console via the Windows API, which exposes both high-level functions and low-level functions.Fonts and colors
A user can configure the console font or color palette, either system-wide or at the application level. An instance of a console application, however, cannot change its font or color palette on the fly.Distinction from DOS
A console application is distinct from an MS-DOS application, even though on Windows, they may not look different. A console application has access to the Windows API and does not run on MS-DOS or compatible systems. A DOS application cannot access the Windows API and only runs on a 32-bit version of Windows with the aid of Virtual DOS machine.Design
Input/output buffering
An instance of a Windows Console has a screen buffer and an input buffer. The input buffer is a queue where events are stored. The output buffer is a rectangular grid where characters are stored, together with their attributes. A console window may have several output buffers, only one of which is active for a given moment.Implementations
In Windows 3.1 and earlier, there is no native support for consoles. Because those version are merely a graphical interface for MS-DOS, most text programs that ran on earlier Windows versions were actually MS-DOS programs running in a window. To simplify the task of porting applications to Windows, early versions of Visual C++ are supplied with QuickWin, a library that implements basic console functionality inside a regular window. A similar library for Borland C++ was called EasyWin.Windows 9x
Windows 9x support is relatively poor compared to Windows NT, because the console window runs in the system virtual DOS machine and so keyboard input to a Win32 console application had to be directed to it by conagent.exe running in a DOS VM that are also used for real DOS applications by hooking the keyboard interrupt.conagent.exe then calls Vcond. Vcond then had to pass the keyboard input to the System VM, and then finally to the Win32 console application. Besides performance, another problem with this implementation is that drives that are local to a DOS VM are not visible to a Win32 console application. This can cause confusion.Under Windows 9x, the screen buffer mirrors the structure of VGA text buffer, with two bytes per character cell: one byte for character code, one byte for attributes. This speeds up operation considerably if the actual VGA text mode is used.
Windows NT and Windows CE
Image:Ubuntu on Windows 10 - bash.png|thumb|right|The Windows Subsystem for Linux running Bash on Windows 10Image:Microsoft Windows CE Version 3.0 cmd.exe Command Prompt 800x574.png|thumb|right|Cmd.exe running on Windows CE 3.0
Traditionally, the Client/Server Runtime Subsystem has been responsible for managing console windows on the Windows NT family of operating systems. In Windows 7, CSRSS spawns one
conhost.exe for each console window, to manage it. In Windows 8 and later, the console applications spawn their conhost.exe processes directly. This change has both security and usability implications. While CSRSS runs in a highly privileged security context, each conhost.exe runs in the same security context as the console app. In addition, in Windows 7, this change enabled console windows to have the features of the Aero Glass theme.On Windows NT and Windows CE, the screen buffer uses four bytes per character cell: two bytes for character code, two bytes for attributes. The character is then encoded in a 16-bit subset of Unicode. For backward compatibility, the console APIs exist in two versions: Unicode and non-Unicode. The non-Unicode versions of APIs can use code page switching to extend the range of displayed characters. Even UTF-8 is available as "code page 65001".
As of the Windows 10 October 2018 update, the Windows Console has full Unicode support.