Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e6a6b0e
Update the TerminalOutput class with a more efficient translation met…
j4james Dec 16, 2019
935cbc2
Add support for designating into different G-sets.
j4james Dec 17, 2019
45a7421
Add support for invoking a particular G-set with locking shifts.
j4james Dec 20, 2019
2ceab25
Add support for invoking a G-set temporarily with single shifts.
j4james Dec 31, 2019
974d80f
Move SS3 tests from OutputEngineTest to InputEngineTest, since they n…
j4james Feb 1, 2020
ff3c164
Make ASCII distinct from the null charset, and initialise G2 and G3 w…
j4james Feb 2, 2020
64fec3f
Add support for all the VT220 character sets.
j4james Feb 4, 2020
290b48e
Add support for invoking a G-set into GR with locking shifts.
j4james Feb 4, 2020
7c5b66f
Add support for the DOCS escape sequences to switch between UTF-8 and…
j4james Feb 6, 2020
7d2931f
Add support for designating 96-character sets.
j4james Feb 6, 2020
10f0c69
Dont't output the DEL character unless it has been translated to some…
j4james Feb 8, 2020
055ebb6
Add support for character sets with two character ids in the designat…
j4james Feb 9, 2020
9d247a1
Restore the code page, if necessary, in response to a reset sequence,…
j4james Feb 11, 2020
92bde3d
Move the character set definitions into a separate header file.
j4james Feb 23, 2020
f8d1f8c
Add support for some of the VT3xx character sets and ISO variants.
j4james Feb 24, 2020
12d0bf2
Add support for more NRC sets from the VT4xx/VT5xx range.
j4james Feb 25, 2020
98982e9
Add support for more DEC supplemental sets from the VT4xx/VT5xx range.
j4james Feb 25, 2020
8ad0829
Add support for more ISO Latin sets from the VT4xx/VT5xx range.
j4james Feb 25, 2020
1b8f02d
Update spell-check dictionaries.
j4james May 24, 2020
22ccad7
Use std::optional for the initialCodePage and improve the DEL transla…
j4james Jun 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/spell-check/dictionary/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97786,6 +97786,7 @@ dalesman
dalesmen
dalespeople
daleswoman
dalet
daleth
daleths
Daleville
Expand Down Expand Up @@ -107561,6 +107562,7 @@ dialystelic
dialystely
dialytic
dialytically
dialytika
dialyzability
dialyzable
dialyzate
Expand Down Expand Up @@ -114004,6 +114006,7 @@ djalmaite
Djambi
djasakid
djave
dje
djebel
djebels
djehad
Expand Down Expand Up @@ -120418,11 +120421,13 @@ DZ
dz
dz.
Dzaudzhikau
dze
dzeren
dzerin
dzeron
Dzerzhinsk
Dzhambul
dzhe
Dzhugashvili
dziggetai
dzo
Expand Down Expand Up @@ -158966,6 +158971,7 @@ Ghaznevid
Ghazzah
Ghazzali
ghbor
ghe
Gheber
gheber
ghebeta
Expand Down Expand Up @@ -160166,6 +160172,7 @@ gizzards
gizzen
gizzened
gizzern
gje
gjedost
Gjellerup
gjetost
Expand Down Expand Up @@ -212347,6 +212354,7 @@ Kizilbash
Kizzee
Kizzie
kJ
kje
Kjeldahl
kjeldahlization
kjeldahlize
Expand Down Expand Up @@ -224856,6 +224864,7 @@ lizzie
Lizzy
LJ
LJBF
lje
Ljod
Ljoka
Ljubljana
Expand Down Expand Up @@ -261607,6 +261616,7 @@ N.J.
NJ
nj
njave
nje
Njord
Njorth
NKGB
Expand Down Expand Up @@ -274785,6 +274795,7 @@ Ogma
ogmic
Ogmios
OGO
ogonek
ogonium
Ogor
O'Gowan
Expand Down Expand Up @@ -329834,6 +329845,7 @@ QN
qn
QNP
QNS
qof
Qoheleth
Qom
qoph
Expand Down Expand Up @@ -371408,6 +371420,7 @@ Shaysite
shazam
Shazar
SHCD
shcha
Shcheglovsk
Shcherbakov
she
Expand Down Expand Up @@ -420973,6 +420986,7 @@ tonometry
Tonopah
tonophant
tonoplast
tonos
tonoscope
tonotactic
tonotaxis
Expand Down Expand Up @@ -428676,6 +428690,7 @@ tsetses
TSF
TSgt
TSH
tshe
Tshi
tshi
Tshiluba
Expand Down Expand Up @@ -477068,6 +477083,7 @@ Yermo
yern
yertchuk
yerth
yeru
yerva
Yerwa-Maiduguri
Yerxa
Expand Down Expand Up @@ -478235,6 +478251,7 @@ Z-bar
ZBB
ZBR
ZD
ze
Zea
zea
zeal
Expand Down Expand Up @@ -478604,6 +478621,7 @@ ZG
ZGS
Zhang
Zhdanov
zhe
Zhitomir
Zhivkov
Zhmud
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/spell-check/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ grep
Greyscale
gridline
groupbox
gset
gsl
GTP
guc
Expand Down Expand Up @@ -1524,6 +1525,7 @@ NOYIELD
NOZORDER
NPM
npos
NRCS
NSTATUS
ntapi
ntcon
Expand Down Expand Up @@ -2023,6 +2025,7 @@ SCROLLSCALE
SCROLLSCREENBUFFER
Scrollup
Scrolluppage
SCS
scursor
sddl
sdeleted
Expand Down Expand Up @@ -2437,6 +2440,7 @@ untimes
UPDATEDISPLAY
UPDOWN
UPKEY
UPSS
upvote
uri
url
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/spell-check/patterns/patterns.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_#\/.]*
https://aka\.ms/[-a-zA-Z0-9?&=\/_]*
https://www\.itscj\.ipsj\.or\.jp/iso-ir/[-0-9]+\.pdf
https://www\.vt100\.net/docs/[-a-zA-Z0-9#_\/.]*
https://www.w3.org/[-a-zA-Z0-9?&=\/_#]*
https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
https://[a-z-]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
(?:0[Xx]|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]?\b
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
microsoft/cascadia-code\@[0-9a-fA-F]{40}
\d+x\d+Logo
Scro\&ll
Expand Down
35 changes: 20 additions & 15 deletions src/host/getset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,25 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
CATCH_RETURN();
}

[[nodiscard]] HRESULT DoSrvSetConsoleOutputCodePage(const unsigned int codepage)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();

// Return if it's not known as a valid codepage ID.
RETURN_HR_IF(E_INVALIDARG, !(IsValidCodePage(codepage)));

// Do nothing if no change.
if (gci.OutputCP != codepage)
{
// Set new code page
gci.OutputCP = codepage;

SetConsoleCPInfo(TRUE);
}

return S_OK;
}

// Routine Description:
// - Sets the codepage used for translating text when calling A versions of functions affecting the output buffer.
// Arguments:
Expand All @@ -932,23 +951,9 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
{
try
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
LockConsole();
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });

// Return if it's not known as a valid codepage ID.
RETURN_HR_IF(E_INVALIDARG, !(IsValidCodePage(codepage)));

// Do nothing if no change.
if (gci.OutputCP != codepage)
{
// Set new code page
gci.OutputCP = codepage;

SetConsoleCPInfo(TRUE);
}

return S_OK;
return DoSrvSetConsoleOutputCodePage(codepage);
}
CATCH_RETURN();
}
Expand Down
1 change: 1 addition & 0 deletions src/host/getset.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void DoSrvSetCursorColor(SCREEN_INFORMATION& screenInfo,

void DoSrvPrivateRefreshWindow(const SCREEN_INFORMATION& screenInfo);

[[nodiscard]] HRESULT DoSrvSetConsoleOutputCodePage(const unsigned int codepage);
void DoSrvGetConsoleOutputCodePage(unsigned int& codepage);

[[nodiscard]] NTSTATUS DoSrvPrivateSuppressResizeRepaint();
Expand Down
11 changes: 11 additions & 0 deletions src/host/outputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,17 @@ bool ConhostInternalGetSet::PrivateWriteConsoleControlInput(const KeyEvent key)
key));
}

// Routine Description:
// - Connects the SetConsoleOutputCP API call directly into our Driver Message servicing call inside Conhost.exe
// Arguments:
// - codepage - the new output codepage of the console.
// Return Value:
// - true if successful (see DoSrvSetConsoleOutputCodePage). false otherwise.
bool ConhostInternalGetSet::SetConsoleOutputCP(const unsigned int codepage)
{
return SUCCEEDED(DoSrvSetConsoleOutputCodePage(codepage));
}

// Routine Description:
// - Connects the GetConsoleOutputCP API call directly into our Driver Message servicing call inside Conhost.exe
// Arguments:
Expand Down
1 change: 1 addition & 0 deletions src/host/outputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class ConhostInternalGetSet final : public Microsoft::Console::VirtualTerminal::

bool PrivateWriteConsoleControlInput(const KeyEvent key) override;

bool SetConsoleOutputCP(const unsigned int codepage) override;
bool GetConsoleOutputCP(unsigned int& codepage) override;

bool IsConsolePty() const override;
Expand Down
12 changes: 9 additions & 3 deletions src/terminal/adapter/DispatchTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ namespace Microsoft::Console::VirtualTerminal::DispatchTypes
ASB_AlternateScreenBuffer = 1049
};

enum VTCharacterSets : wchar_t
namespace CharacterSets
{
DEC_LineDrawing = L'0',
USASCII = L'B'
constexpr auto DecSpecialGraphics = std::make_pair(L'0', L'\0');
constexpr auto ASCII = std::make_pair(L'B', L'\0');
}

enum CodingSystem : wchar_t
{
ISO2022 = L'@',
UTF8 = L'G'
};

enum TabClearType : unsigned short
Expand Down
7 changes: 6 additions & 1 deletion src/terminal/adapter/ITermDispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ class Microsoft::Console::VirtualTerminal::ITermDispatch
virtual bool DeviceAttributes() = 0; // DA1
virtual bool Vt52DeviceAttributes() = 0; // VT52 Identify

virtual bool DesignateCharset(const wchar_t wchCharset) = 0; // SCS
virtual bool DesignateCodingSystem(const wchar_t codingSystem) = 0; // DOCS
virtual bool Designate94Charset(const size_t gsetNumber, const std::pair<wchar_t, wchar_t> charset) = 0; // SCS
virtual bool Designate96Charset(const size_t gsetNumber, const std::pair<wchar_t, wchar_t> charset) = 0; // SCS
virtual bool LockingShift(const size_t gsetNumber) = 0; // LS0, LS1, LS2, LS3
virtual bool LockingShiftRight(const size_t gsetNumber) = 0; // LS1R, LS2R, LS3R
virtual bool SingleShift(const size_t gsetNumber) = 0; // SS2, SS3

virtual bool SoftReset() = 0; // DECSTR
virtual bool HardReset() = 0; // RIS
Expand Down
Loading