Screen Buffer and Console Window
The screen buffer is a two-dimensional array that stores characters and their foreground and background color.
The console window is a rectangular window that provides a view onto the screen buffer. If the size of the console window is smaller than the screen buffer, vertically, horizontally or both, the console displays scrollbars which allow to view different parts of the screen buffer.
The cursor displays the special position in the screen buffer where text is written to or read from.
The cursor can be made hidden. If it is visible, the console window is always moved so that the cursor is visible.
Configuring settings
The settings of the console host are taken from various places:
- Hardcoded values in
ConhostV1.dll
(or conhostv2.dll
?)
-
HKCU\Console
- Subkeys of
HKCU\Console
(where the key name is either the exe path of the console application (backslashes replace by underscores) or the application's title
- Windows shortcut files (
*.lnk
)
A list of settings that can be adjusted is
here.
When an application is started through a *.lnk
file, the values in the subkey of HKCU\Console
are irrelevant.
The menu of an application that uses
conhost.exe
(such as
PowerShell in the following picture) contains the two entries
Defaults and
Properties.
Choosing
Defaults allows to change the settings that are stored in
HKCU\Console
while
Properties allows to change the settings in either the subkey of that registry key or the
*.lnk
file.