<p dir="auto">Something wrong with keyboard modifiers processing?</p>
<p dir="auto">We have wrong processing of keyboard input with modifiers... For example:</p>
<div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using System;

namespace ConsoleApp1
{
	class Program
	{
		static void Main(string[] args)
		{
			ConsoleKeyInfo cki;
			do
			{
				cki = Console.ReadKey();
				Console.Write(&quot; --- You pressed &quot;);
				if ((cki.Modifiers &amp; ConsoleModifiers.Alt) != 0)
				{
					Console.Write(&quot;ALT+&quot;);
				}
				if ((cki.Modifiers &amp; ConsoleModifiers.Shift) != 0)
				{
					Console.Write(&quot;SHIFT+&quot;);
				}
				if ((cki.Modifiers &amp; ConsoleModifiers.Control) != 0)
				{
					Console.Write(&quot;CTL+&quot;);
				}
				Console.WriteLine(cki.Key.ToString());
			}
			while (cki.Key != ConsoleKey.Escape);
		}
	}
}"><pre class="notranslate"><span class="pl-k">using</span> System<span class="pl-kos">;</span>

<span class="pl-k">namespace</span> <span class="pl-v">ConsoleApp1</span>
<span class="pl-kos">{</span>
	<span class="pl-k">class</span> <span class="pl-smi">Program</span>
	<span class="pl-kos">{</span>
		<span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">void</span> <span class="pl-en">Main</span><span class="pl-kos">(</span><span class="pl-smi">string</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-s1">args</span><span class="pl-kos">)</span>
		<span class="pl-kos">{</span>
			<span class="pl-smi">ConsoleKeyInfo</span> <span class="pl-s1">cki</span><span class="pl-kos">;</span>
			<span class="pl-k">do</span>
			<span class="pl-kos">{</span>
				<span class="pl-s1">cki</span> <span class="pl-c1">=</span> Console<span class="pl-kos">.</span><span class="pl-en">ReadKey</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
				Console<span class="pl-kos">.</span><span class="pl-en">Write</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span> --- You pressed <span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
				<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-kos">(</span>cki<span class="pl-kos">.</span>Modifiers <span class="pl-c1">&amp;</span> ConsoleModifiers<span class="pl-kos">.</span>Alt<span class="pl-kos">)</span> <span class="pl-c1">!=</span> <span class="pl-c1">0</span><span class="pl-kos">)</span>
				<span class="pl-kos">{</span>
					Console<span class="pl-kos">.</span><span class="pl-en">Write</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>ALT+<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
				<span class="pl-kos">}</span>
				<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-kos">(</span>cki<span class="pl-kos">.</span>Modifiers <span class="pl-c1">&amp;</span> ConsoleModifiers<span class="pl-kos">.</span>Shift<span class="pl-kos">)</span> <span class="pl-c1">!=</span> <span class="pl-c1">0</span><span class="pl-kos">)</span>
				<span class="pl-kos">{</span>
					Console<span class="pl-kos">.</span><span class="pl-en">Write</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>SHIFT+<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
				<span class="pl-kos">}</span>
				<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-kos">(</span>cki<span class="pl-kos">.</span>Modifiers <span class="pl-c1">&amp;</span> ConsoleModifiers<span class="pl-kos">.</span>Control<span class="pl-kos">)</span> <span class="pl-c1">!=</span> <span class="pl-c1">0</span><span class="pl-kos">)</span>
				<span class="pl-kos">{</span>
					Console<span class="pl-kos">.</span><span class="pl-en">Write</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>CTL+<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
				<span class="pl-kos">}</span>
				Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>cki<span class="pl-kos">.</span>Key<span class="pl-kos">.</span><span class="pl-en">ToString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
			<span class="pl-kos">}</span>
			<span class="pl-k">while</span> <span class="pl-kos">(</span>cki<span class="pl-kos">.</span>Key <span class="pl-c1">!=</span> ConsoleKey<span class="pl-kos">.</span>Escape<span class="pl-kos">)</span><span class="pl-kos">;</span>
		<span class="pl-kos">}</span>
	<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Same keys sequence is pressed... <kbd>1</kbd> <kbd>2</kbd> ... <kbd>0</kbd> <kbd>RCtrl</kbd>+<kbd>1</kbd> <kbd>RCtrl</kbd>+<kbd>2</kbd> <kbd>RCtrl</kbd>+<kbd>3</kbd>... <kbd>RCtrl</kbd>+<kbd>0</kbd><br>
<kbd>LCtrl</kbd>+<kbd>1</kbd> <kbd>LCtrl</kbd>+<kbd>2</kbd>  <kbd>LCtrl</kbd>+<kbd>3</kbd> <kbd>LCtrl</kbd>+<kbd>4</kbd></p>
<p dir="auto">We have some, but also wrong result only for <kbd>Ctrl</kbd>+<kbd>2</kbd>... Shift modifier added.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1778999/60325129-392af380-998f-11e9-962b-354f7c755531.png"><img src="https://user-images.githubusercontent.com/1778999/60325129-392af380-998f-11e9-962b-354f7c755531.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Same behaviour also with more complicated software -  "Far Manager" for example (in this situation problem not with simple Console.ReadKey but with keyboard events processing. In this example we don't see any reactions of software on pressing <kbd>Ctrl</kbd> like we can see in old console. So problems also with keyboard modifiers).</p>
<p dir="auto"><strong>Your Windows build number:</strong><br>
10.0.18362.86</p>
<p dir="auto"><strong>What you're doing and what's happening:</strong><br>
Trying to enter the <code class="notranslate">@</code> sign on a Swedish keyboard in a PowerShell console using <code class="notranslate">Alt Gr</code> + <code class="notranslate">2</code>.<br>
See animated gif:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/357872/57315225-7099c400-70f3-11e9-803f-4d60d11feef5.gif"><img src="https://user-images.githubusercontent.com/357872/57315225-7099c400-70f3-11e9-803f-4d60d11feef5.gif" alt="terminal" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>What's wrong / what should be happening instead:</strong><br>
Windows terminal shows <code class="notranslate">digit-argument</code> instead of outputting the <code class="notranslate">@</code> sign as expected.</p>
<p dir="auto">It's possible this is a PEBKAC error somehow but the problem doesn't show up in the normal PowerShell console... 😓</p>