Windows Console

Short description: Infrastructure for console applications in Microsoft Windows

Windows Console

A Windows Console with cmd.exe in Windows 10 20H2

Other names| Win32 console
Developer(s)| Microsoft
Repository| github.com/microsoft/terminal/tree/main/src/host
Written in| C++
Operating system| Microsoft Windows
Platform| IA-32, x86-64, ARM64
Type| Terminal emulator
License| MIT License
Website| docs.microsoft.com/en-us/windows/console/

Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode (so as to occupy the entire screen). The user can switch between the two using the key combination. The text mode is unavailable in Windows Vista and later. Starting with Windows 10, however, a native full-screen mode is available.

Windows Console instances are typically used for apps that do not need to display images but might use color. Examples include cmd.exe, Windows PowerShell, Far Manager, and Midnight Commander.

In 2019, the console host was open-sourced under the MIT License, alongside Windows Terminal.[1]

## Contents

* 1 Window and full screen modes
* 2 Details
* 3 Implementations
* 3.1 Windows 9x
* 3.2 Windows NT and Windows CE
* 4 See also
* 5 References
* 6 External links

## Window and full screen modes

Windows PowerShell on Windows Vista

Midnight Commander using box-drawing characters

In Windows, a console application may run in two modes.

One mode places the text in a window and uses an operating system's font rendering. In this mode, an application's interaction with user is controlled by the windowing system. This is analogous to X Window System applications such as xterm.

The second is the full-screen mode. In Windows XP and earlier, the full-screen console uses a hardware text mode and uploads a raster font to the video adapter. This is analogous to a text 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.[2] This mode was deprecated in Windows Vista.[3] It was possible to circumvent this issue by installing a Windows XP display driver;[3] however, Windows 8 and later do not accept them.[4] Windows 10 features a full-screen mode once again, but this implementation uses the native Windows rendering subsystem, instead of the text mode. It can have as many columns and rows as fits on the screen.[5]

Apps can be made to switch between the two modes using the key combination.

## Details

The input buffer is a queue where events are stored (from keyboard, mouse etc.). 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 (i.e. displayed) for a given moment. Apps may programmatically interact with Windows Console through Windows API, which exposes both high-level functions (such as `ReadConsole` and `WriteConsole`) and low-level functions (e.g. `ReadConsoleInput` and `WriteConsoleOutput`).[6]

Users can change the color palette or font, either on the system-wide level or app-level. Each instance of a console app themselves, however, cannot change its color palette or font on the fly.

Windows Console apps are distinct from MS-DOS apps, even though on Windows (especially on Windows 9x), they may not look different. Windows Console apps have access to entire Windows API and do not run on MS-DOS or compatible operating systems. DOS apps, however, cannot access Windows API and may only run on 32-bit versions of Windows with the aid of Virtual DOS machine (VDM).

## Implementations

Prior to Windows 95, there is no native support for consoles. Because Windows 3.1 and earlier 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

Command.com running in a Windows console on Windows 95

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 (which is a VxD). 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 (the character must be in OEM character set, the attribute is with high-intensity background/no blinking). This speeds up operation considerably if the actual VGA text mode is used.

### Windows NT and Windows CE

The Windows Subsystem for Linux running Bash on Windows 10

Cmd.exe running on Windows CE 3.0

Traditionally, the Client/Server Runtime Subsystem (CSRSS) has been responsible for managing console windows on the Windows NT family of operating systems.[7] In Windows 7, CSRSS spawns one `conhost.exe` for each console window, to manage it. In Windows 8 and later, the console apps 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.[8]

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 (UCS-2).[9] 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 (but only if TrueType fonts are used for the console window, thereby extending the range of codes available). Even UTF-8 is available as "code page 65001"[10] (displaying only from the UCS-2 subset of full Unicode[citation needed]).

As of the Windows 10 October 2018 update, the Windows Console has full Unicode support.[11]

## See also

* Comparison of terminal emulators
* Command-line interface
* Shell (computing)
* System console
* Windows Terminal
* Linux console
* Text-based (computing)
* List of formerly proprietary software

## References

1. ↑ Cinnamon, Kayla (May 6, 2019). "Introducing Windows Terminal". Microsoft. https://devblogs.microsoft.com/commandline/introducing-windows-terminal/.
2. ↑ Julio Sanchez; Maria P. Canton (2003), "VGA Fundamentals, Part II: DOS Graphics", The PC Graphics Handbook (for C++ Programmers), CRC Press, p. 125, ISBN 0849316782
3. ↑ 3.0 3.1 "Some 16-bit DOS-based Programs and the Command Prompt will not run in full-screen mode in Windows Vista and in Windows 7". Support. Microsoft. 2011-09-23. http://support.microsoft.com/kb/926657.
4. ↑ "Roadmap for Developing Drivers for the Windows 2000 Display Driver Model (XDDM)". Windows Dev Center - Hardware. Microsoft. 16 November 2013. http://msdn.microsoft.com/en-us/library/windows/hardware/ff569512.aspx. "XDDM and VGA drivers will not compile on Windows 8 and later versions"
5. ↑ Tkachenko, Sergey (2014-11-24). "Open command prompt fullscreen in Windows 10" (in en-US). https://winaero.com/open-command-prompt-fullscreen-in-windows-10/.
6. ↑ "Console Modes". Microsoft. https://docs.microsoft.com/en-us/windows/console/console-modes.
7. ↑ Microsoft Security Advisory (930181): Exploit Code Published Affecting Windows Client Server Run-Time Subsystem
8. ↑ Yosifovich, Pavel; Ionescu, Alex; Russinovich, Mark E.; Solomon, David A. (2017-05-15). Windows Internals, Part 1: System architecture, processes, threads, memory management, and more (7th ed.). Redmond, Washington: Microsoft Press. p. 67. ISBN 9780735684188.
9. ↑ "Console Reference". Microsoft. 2009. http://msdn.microsoft.com/en-us/library/ms682087(VS.85).aspx.
10. ↑ "Release Notes" (in en-us). https://docs.microsoft.com/en-us/windows/wsl/release-notes. "Console: Fix for no output text being displayed in codepage 65001 (utf8)"
11. ↑ Turner, Rich (2018-11-15). "Windows Command-Line: Unicode and UTF-8 Output Text Buffer" (in en-us). Microsoft. https://devblogs.microsoft.com/commandline/windows-command-line-unicode-and-utf-8-output-text-buffer/.

## External links

* Windows Console documentation
* Windows Command-Line: Backgrounder blog

* v
* t
* e

Microsoft APIs and frameworks

Graphics|

* Desktop Window Manager
* Direct2D
* Direct3D
* D3D (extensions)
* GDI / GDI+
* WPF
* Silverlight
* WinRT XAML
* Windows Color System
* Windows Image Acquisition
* Windows Imaging Component
* DirectX Graphics Infrastructure (DXGI)
* Windows Advanced Rasterization Platform
* WinG

Audio|

* DirectMusic
* DirectSound
* DirectX plugin
* XACT
* Speech API
* XAudio2

Multimedia|

* DirectX
* Media Objects
* Video Acceleration
* Xinput
* DirectInput
* DirectShow
* Image Mastering API
* Managed DirectX
* Media Foundation
* XNA
* Windows Media
* Video for Windows

Web|

* MSHTML
* RSS Platform
* JScript
* VBScript
* BHO
* XDR
* SideBar Gadgets
* TypeScript

Data access|

* Data Access Components (MDAC)
* ADO
* ADO.NET
* ODBC
* OLE DB
* Extensible Storage Engine
* Entity Framework
* Sync Framework
* Jet Engine
* MSXML
* OPC

Networking|

* Winsock
* LSP
* Winsock Kernel
* Filtering Platform
* NDIS
* Windows Rally
* BITS
* P2P API
* MSMQ
* MS MPI
* DirectPlay

Communication|

* Messaging API
* Telephony API
* WCF

Administration and
management|

* Win32 console
* Windows Script Host
* WMI (extensions)
* PowerShell
* Task Scheduler
* Offline Files
* Shadow Copy
* Windows Installer
* Error Reporting
* Event Log
* Common Log File System

Component model|

* COM
* COM+
* ActiveX
* Distributed Component Object Model
* .NET Framework

Libraries|

* Framework Class Library
* Microsoft Foundation Classes (MFC)
* Active Template Library (ATL)
* Windows Template Library (WTL)

Device drivers|

* WDM
* WDF
* KMDF
* UMDF
* WDDM
* NDIS
* UAA
* BDA
* VxD

Security|

* Crypto API
* CAPICOM
* Windows CardSpace
* Data Protection API
* Security Support Provider Interface (SSPI)

.NET|

* ASP.NET
* ADO.NET
* Remoting
* Silverlight
* TPL
* WCF
* WCS
* WPF
* WF

Software factories|

* EFx Factory
* Enterprise Library
* Composite UI
* CCF
* CSF

IPC|

* MSRPC
* Dynamic Data Exchange (DDE)
* Remoting
* WCF

Accessibility|

* Active Accessibility
* UI Automation

Text and multilingual
support|

* DirectWrite
* Text Services Framework
* Text Object Model
* Input method editor
* Language Interface Pack
* Multilingual User Interface
* Uniscribe

* v
* t
* e

Microsoft free and open-source software (FOSS)

Overview|

* Microsoft and open source
* Shared Source Initiative

Software|

| Applications|

* Atom
* Conference XP
* File Manager
* Open Live Writer
* PowerToys for Windows 10
* Windows Calculator
* Windows Console
* Windows Terminal
* WorldWide Telescope
* XML Notepad

|

Video games|

* Allegiance

Programming languages|

* Bosque
* C#
* Dafny
* F#
* F*
* IronPython
* IronRuby
* P
* PowerShell
* Q#
* R Open
* Small Basic
* TypeScript
* Visual Basic .NET

Frameworks and
development tools|

* .NET Bio
* .NET Core
* .NET Framework
* .NET Micro Framework
* AirSim
* ASP.NET
* ASP.NET AJAX
* ASP.NET Core
* ASP.NET MVC
* ASP.NET Razor
* ASP.NET Web Forms
* Blazor
* C++/WinRT
* ChakraCore
* CLR Profiler
* DiskSpd
* Dryad
* Electron
* Entity Framework
* Managed Extensibility Framework
* Microsoft Automatic Graph Layout
* Microsoft Cognitive Toolkit
* Microsoft Detours
* ML.NET
* Mono
* MonoDevelop
* MSBuild
* NuGet
* Open Management Infrastructure
* Orleans
* ProcDump
* R Tools for Visual Studio
* Roslyn
* Sandcastle
* SignalR
* StyleCop
* SVNBridge
* T2 Temporal Prover
* Text Template Transformation Toolkit
* vcpkg
* Virtual File System for Git
* Visual Studio Code
* Windows Communication Foundation
* Windows Driver Frameworks
* Windows Forms
* Windows Presentation Foundation
* Windows Template Library
* WinJS
* WiX
* Z3 Theorem Prover

Operating systems|

* MS-DOS
* Barrelfish

Licenses|

* Microsoft Public License
* Microsoft Reciprocal License

Related|

* .NET Foundation
* F Sharp Software Foundation
* Microsoft Open Specification Promise
* Outercurve Foundation

Category

* v
* t
* e

Terminal emulators

List|

* ConEmu
* iTerm2
* GNOME Terminal
* guake
* Konsole
* macOS Terminal
* mintty
* mrxvt
* rxvt
* Terminator
* Tilda
* Xfce Terminal
* Terminology
* Windows Console
* Windows Terminal
* xterm
* Yakuake

Related|

* luit
* kmscon

* v
* t
* e

Microsoft Windows components

Management
tools|

* App Installer
* Command Prompt
* Control Panel
* Applets
* Device Manager
* Disk Cleanup
* Disk Defragmenter
* Driver Verifier
* DxDiag
* Event Viewer
* IExpress
* Management Console
* Netsh
* Performance Monitor
* Recovery Console
* Resource Monitor
* Settings
* Sysprep
* System Configuration
* System File Checker
* System Information
* System Policy Editor
* System Restore
* Task Manager
* Windows Error Reporting
* Windows Ink
* Windows Installer
* PowerShell
* Windows Update
* Windows Insider
* WinRE
* WMI

Apps|

* Alarms & Clock
* Calculator
* Calendar
* Camera
* Character Map
* Cortana
* Edge
* Fax and Scan
* Feedback Hub
* File Manager
* Get Help
* Groove Music
* Magnifier
* Mail
* Messaging
* Maps
* Media Player
* Movies & TV
* Mobility Center
* Money
* News
* Narrator
* Notepad
* OneDrive
* OneNote
* Paint
* Paint 3D
* People
* Phone Companion
* Photos
* Quick Assist
* Snipping Tool
* Speech Recognition
* Skype
* Sports
* Sticky Notes
* View 3D
* Store
* Tips
* Voice Recorder
* Wallet
* Weather
* Windows To Go
* Windows Story Remix
* WordPad
* Xbox Console Companion
* Your Phone

Shell|

* Action Center
* Aero
* AutoPlay
* AutoRun
* ClearType
* Explorer
* Search
* Indexing Service
* IFilter
* Saved search
* Namespace
* Special folder
* Start menu
* Taskbar
* Task View
* Windows Spotlight
* Windows XP visual styles

Services|

* Service Control Manager
* BITS
* CLFS
* Multimedia Class Scheduler
* Shadow Copy
* Task Scheduler
* Error Reporting
* Wireless Zero Configuration

File systems|

* CDFS
* DFS
* exFAT
* IFS
* FAT
* NTFS
* Hard link
* Junction point
* Mount Point
* Reparse point
* Symbolic link
* TxF
* EFS
* ReFS
* UDF

Server|

* Domains
* Active Directory
* DNS
* Group Policy
* Roaming user profiles
* Folder redirection
* Distributed Transaction Coordinator
* MSMQ
* Windows Media Services
* Rights Management Services
* IIS
* Remote Desktop Services
* WSUS
* SharePoint
* Network Access Protection
* PWS
* DFS Replication
* Remote Differential Compression
* Print Services for UNIX
* Remote Installation Services
* Windows Deployment Services
* System Resource Manager
* Hyper-V
* Server Core

Architecture|

* Architecture of Windows NT
* Startup process
* NT
* Vista
* CSRSS
* Desktop Window Manager
* Portable Executable
* EXE
* DLL
* Enhanced Write Filter
* Graphics Device Interface
* hal.dll
* I/O request packet
* Imaging Format
* Kernel Transaction Manager
* Library files
* Logical Disk Manager
* LSASS
* MinWin
* NTLDR
* Ntoskrnl.exe
* Object Manager
* Open XML Paper Specification
* Registry
* Resource Protection
* Security Account Manager
* Server Message Block
* Shadow Copy
* SMSS
* System Idle Process
* USER
* WHEA
* Win32 console
* Winlogon
* WinUSB

Security|

* Security and Maintenance
* AppLocker
* BitLocker
* Credential Guard
* Data Execution Prevention
* Family Safety
* Kernel Patch Protection
* Mandatory Integrity Control
* Protected Media Path
* User Account Control
* User Interface Privilege Isolation
* Windows Defender
* Windows Firewall

Compatibility|

* COMMAND.COM
* Virtual DOS machine
* Windows on Windows
* WoW64
* Windows Subsystem for Linux

API|

* Active Scripting
* WSH
* VBScript
* JScript
* COM
* ActiveX
* ActiveX Document
* COM Structured storage
* DCOM
* OLE
* OLE Automation
* Transaction Server
* DirectX
* .NET Framework
* Universal Windows Platform
* Windows Mixed Reality
* Windows Runtime
* WinUSB

Games|

* Solitaire Collection

Discontinued|

| Games|

* 3D Pinball
* Chess Titans
* FreeCell
* Hearts
* InkBall
* Hold 'Em
* Purble Place
* Reversi
* Spider Solitaire
* Solitaire
* Tinker

|

Apps|

* ActiveMovie
* Anytime Upgrade
* Address Book
* Backup and Restore
* Cardfile
* CardSpace
* CD Player
* Contacts
* Desktop Gadgets
* Diagnostics
* DriveSpace
* DVD Maker
* Easy Transfer
* Fax
* Food & Drink
* Help and Support Center
* Health & Fitness
* HyperTerminal
* Internet Explorer
* Journal
* Media Center
* Meeting Space
* Messaging
* Messenger
* Mobile Device Center
* Movie Maker
* MSN Dial-up
* NetMeeting
* NTBackup
* Outlook Express
* Travel
* Photo Gallery
* Photo Viewer
* Program Manager
* Steps Recorder
* Syskey
* WinHelp
* Write

Others|

* ScanDisk
* File Protection
* Media Control Interface
* Next-Generation Secure Computing Base
* POSIX subsystem
* Interix
* Video for Windows
* Windows SideShow
* Windows Services for UNIX
* Windows System Assessment Tool
* WinFS

Spun off to
Microsoft Store|

* DVD Player
* Hover!
* Mahjong
* Minesweeper

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Windows Console. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Windows_Console&oldid=3464727"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template