Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Windows Console
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|GUI for Windows console applications}} {{distinguish|text = [[Windows Terminal]]}} {{Use mdy dates|date=November 2023}} {{Use American English|date=November 2023}} {{Infobox software | name = Windows Console | title = | logo = | logo caption = | logo_size = | logo_alt = | screenshot = A_Windows_Console_Window_Running_on_Windows_10_20H2.png | caption = A Windows Console with [[cmd.exe]] in [[Windows 10 20H2]] | screenshot_size = | screenshot_alt = | collapsible = | other_names = Win32 console | author = | developer = [[Microsoft]] | released = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --> | discontinued = | latest release version = | latest release date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --> | latest preview version = | latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --> | repo = {{URL|https://github.com/microsoft/terminal/tree/main/src/host}} | programming language = [[C++]] | operating system = [[Microsoft Windows]] | platform = [[IA-32]], [[x86-64]], [[ARM64]] | size = | language = | language count = <!-- DO NOT include this parameter unless you know what it does --> | language footnote = | genre = [[Terminal emulator]] | license = [[MIT License]] | website = {{URL|https://docs.microsoft.com/en-us/windows/console/}} }} '''Windows Console''' is a [[GUI]] application for running [[console application]]s in [[Windows]]. Windows Console is used for running [[Text-based (computing)|text-based]] [[computer program|programs]] such as [[operating system]] [[shell (computing)|shells]] (i.e. [[Command Prompt]] and [[PowerShell]]), [[software utility|utilities]] (i.e. [[Far Manager]]) and some, generally older, [[application software|applications]] (i.e. [[Midnight Commander]]). [[Windows Terminal]] was introduced in [[Windows 10]] as a replacement for Windows Console.<ref name="introducing-windows-terminal">{{cite web|url=https://devblogs.microsoft.com/commandline/introducing-windows-terminal/|title=Introducing Windows Terminal|first=Kayla|last=Cinnamon|date=May 6, 2019|publisher=Microsoft Corporation|access-date=November 20, 2020}}</ref> In 2019, the console host was [[Open-source software|open-sourced]] under the [[MIT License]], alongside Windows Terminal.<ref>{{Cite web|url=https://devblogs.microsoft.com/commandline/introducing-windows-terminal/|title=Introducing Windows Terminal|last=Cinnamon|first=Kayla|date=May 6, 2019|website=Windows Command Line Tools For Developers|publisher=[[Microsoft]]|access-date=May 10, 2019}}</ref> ==Use== ===Full-screen mode=== [[Image:Windows PowerShell 1.0 PD.png|thumb|right|[[Windows PowerShell]] on [[Windows Vista]] ]] [[Image:GNU Midnight Commander 4.1.36 Windows Vista.png|thumb|right|[[Midnight Commander]] using [[box-drawing character]]s]] Windows Console runs in either window or full-screen mode. The mode can be toggled by pressing {{keypress|Alt|Enter}}. In window mode, the console writes text in a [[window (computing)|window]] and uses an operating system's [[font rendering]]. In this mode, an application's [[human–computer interaction|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 [[Display resolution|resolution]] of 80 [[characters per line|columns]] by 28 rows.<ref name="VGA Fundamentals">{{citation|chapter=VGA Fundamentals, Part II: DOS Graphics|title=The PC Graphics Handbook (for C++ Programmers)|author=Julio Sanchez|author2=Maria P. Canton|year=2003|type=Book|page=125|isbn=0849316782|publisher=CRC Press}}</ref> This mode was removed in [[Windows Vista]],<ref name=fullscreen-deprecated>{{cite web|title=Some 16-bit DOS-based Programs and the Command Prompt will not run in full-screen mode in Windows Vista and in Windows 7|url=http://support.microsoft.com/kb/926657|date=2011-09-23|work=Support |publisher=Microsoft}}</ref> although until [[Windows 8]], it was possible to circumvent this issue <!--you mean enable it?--> by installing a Windows XP display driver.<ref name=fullscreen-deprecated /><ref>{{cite web|title=Roadmap for Developing Drivers for the Windows 2000 Display Driver Model (XDDM)|url=http://msdn.microsoft.com/en-us/library/windows/hardware/ff569512.aspx|work=Windows Dev Center - Hardware|publisher=[[Microsoft]]|access-date=16 December 2013|date=16 November 2013|quote=XDDM and VGA drivers will not compile on Windows 8 and later versions}}</ref> [[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.<ref>{{Cite web|url=https://winaero.com/open-command-prompt-fullscreen-in-windows-10/|title=Open command prompt fullscreen in Windows 10|last=Tkachenko|first=Sergey|date=2014-11-24|website=Winaero|language=en-US|access-date=2019-07-31}}</ref> ===Programmatic access=== A program may programmatically interact with its host console via [[Windows API]], which exposes both high-level functions (such as <code>ReadConsole</code> and <code>WriteConsole</code>) and low-level functions (e.g. <code>ReadConsoleInput</code> and <code>WriteConsoleOutput</code>).<ref>{{cite web |title=Console Modes |url=https://docs.microsoft.com/en-us/windows/console/console-modes |website=Windows Console documentation |publisher=[[Microsoft]] |via=Microsoft Docs |access-date=13 October 2020}}</ref> ===Fonts and colors=== A user can configure the console [[computer font|font]] or [[palette (computing)|color palette]]; either system-wide or 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 (especially on [[Windows 9x]]), they may not look different. A console application has access to [[Windows API]] and does not run on MS-DOS or compatible systems. A DOS application cannot access Windows API and only runs on a 32-bit version of Windows with the aid of [[Virtual DOS machine]] (VDM). ==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 (from [[computer keyboard|keyboard]], [[computer mouse|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. ==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=== [[File:Microsoft Windows 95 Version 4.00.1111 command.com MS-DOS Prompt 492x259.png|thumb|[[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. <code>conagent.exe</code> 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-compatible text mode|VGA text buffer]], with two bytes per character cell: one byte for character code, one byte for attributes (the character must be in [[OEMCP|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=== [[Image:Ubuntu on Windows 10 - bash.png|thumb|right|The [[Windows Subsystem for Linux]] running [[Bash (Unix shell)|Bash]] on [[Windows 10]]]] [[Image:Microsoft Windows CE Version 3.0 (Build 126) cmd.exe Command Prompt 800x574.png|thumb|right|[[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.<ref>[http://www.microsoft.com/technet/security/advisory/928604.mspx Microsoft Security Advisory (930181): Exploit Code Published Affecting Windows Client Server Run-Time Subsystem]</ref> In [[Windows 7]], CSRSS spawns one <code>conhost.exe</code> for each console window, to manage it. In [[Windows 8]] and later, the console applications spawn their <code>conhost.exe</code> processes directly. This change has both security and usability implications. While CSRSS runs in a highly privileged security context, each <code>conhost.exe</code> 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 [[Windows Aero#Windows Aero theme|Aero Glass theme]].<ref>{{cite book |last1=Yosifovich |first1=Pavel |last2=Ionescu |first2=Alex |last3=Russinovich |first3=Mark E. |last4=Solomon |first4=David A. |date=2017-05-15 |title=Windows Internals, Part 1: System architecture, processes, threads, memory management, and more |location=Redmond, Washington |publisher=Microsoft Press |page=67 |isbn=9780735684188 |edition=7th }}</ref> 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]]).<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/ms682087(VS.85).aspx |title=Console Reference |publisher=Microsoft |year=2009 |access-date=2010-01-01}}</ref> 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"<ref>{{cite web|title=Release Notes|url=https://docs.microsoft.com/en-us/windows/wsl/release-notes|website=docs.microsoft.com|date=June 27, 2022 |language=en-us|quote=Console: Fix for no output text being displayed in codepage 65001 (utf8)}}</ref> (displaying only from the UCS-2 subset of full Unicode{{cn|date=September 2014}}). As of the [[Windows 10]] October 2018 update, the Windows Console has full Unicode support.<ref>{{cite web|title=Windows Command-Line: Unicode and UTF-8 Output Text Buffer|url=https://devblogs.microsoft.com/commandline/windows-command-line-unicode-and-utf-8-output-text-buffer/|website=Windows Command Line Tools For Developers|language=en-us|first=Rich|last=Turner|publisher=Microsoft|date=2018-11-15|access-date=2019-06-14}}</ref> ==See also== {{Portal|Free and open-source software}} * [[Command-line interface]] * [[Comparison of terminal emulators]] * [[Linux console]] * [[List of formerly proprietary software]] * [[System console]] ==References== {{Reflist}} ==External links== *[https://docs.microsoft.com/en-us/windows/console/ Windows Console documentation] *[https://devblogs.microsoft.com/commandline/windows-command-line-backgrounder/ ''Windows Command-Line: Backgrounder'' blog] {{Microsoft APIs}} {{Microsoft FOSS}} {{Terminal emulator}} {{Windows Components}} [[Category:Formerly proprietary software]] [[Category:Free and open-source software]] [[Category:Free terminal emulators]] [[Category:Microsoft free software]] [[Category:Software using the MIT license]] [[Category:Text user interface]] [[Category:Windows administration]] [[Category:Windows-only free software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Cn
(
edit
)
Template:Distinguish
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Keypress
(
edit
)
Template:Main other
(
edit
)
Template:Microsoft APIs
(
edit
)
Template:Microsoft FOSS
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)
Template:Terminal emulator
(
edit
)
Template:Use American English
(
edit
)
Template:Use mdy dates
(
edit
)
Template:Windows Components
(
edit
)