Alt+Shift+Plus ... lose focus #12081

Closed
opened 2026-01-31 03:05:53 +00:00 by claunia · 7 comments
Owner

Originally created by @vefatica on GitHub (Jan 15, 2021).

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Windows Terminal version (if applicable):
Microsoft Windows 10 Pro for Workstations
10.0.19042.746 (2009, 20H2)
WindowsTerminalPreview_1.5.3242.0_x64
Any other software?

Steps to reproduce

With another GUI app on the desktop (Notepad or Firefox will do) and working in WT, press Alt-Shift+Plus (split) AND BE SLOW ABOUT RELEASING THE KEYS.

Expected behavior

Further splitting of panes (as happens if there's no other window on the desktop).

Actual behavior

Focus switches to the other desktop app.

I've done this a dozen times while composing this post. If I'm slow to release Alt-Shift-Plus, focus goes to Firefox. FWIW, I use a rather old PS/2 keyboard.

Originally created by @vefatica on GitHub (Jan 15, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] Windows Terminal version (if applicable): Microsoft Windows 10 Pro for Workstations 10.0.19042.746 (2009, 20H2) WindowsTerminalPreview_1.5.3242.0_x64 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> With another GUI app on the desktop (Notepad or Firefox will do) and working in WT, press Alt-Shift+Plus (split) AND BE SLOW ABOUT RELEASING THE KEYS. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Further splitting of panes (as happens if there's no other window on the desktop). # Actual behavior <!-- What's actually happening? --> Focus switches to the other desktop app. I've done this a dozen times while composing this post. If I'm slow to release Alt-Shift-Plus, focus goes to Firefox. FWIW, I use a rather old PS/2 keyboard.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-AttentionNeeds-Repro labels 2026-01-31 03:05:53 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jan 15, 2021):

Is there a particular key up that seems to trigger this? Like, is it the keyup while Alt+Shift is presssed, or Alt+plus, Shift+plus? I can't get this to repro at all, but I also can't really release the keys on the slaptop slowly, I can only release them one at a time.

@zadjii-msft commented on GitHub (Jan 15, 2021): Is there a particular key up that seems to trigger this? Like, is it the keyup while <kbd>Alt+Shift</kbd> is presssed, or <kbd>Alt+plus</kbd>, <kbd>Shift+plus</kbd>? I can't get this to repro at all, but I also can't really release the keys on the slaptop _slowly_, I can only release them one at a time.
Author
Owner

@vefatica commented on GitHub (Jan 15, 2021):

It's the delay in releasing Alt which triggers it. That is, If I release Plus right away and pause a bit, or release Plus and Shift right away and pause a bit, it happens. If I release Plus and Alt (or just Alt) right away and pause a bit, it does not happen.

This is an interesting exercise in manual dexterity!

I'm trying to repro with SendInput (not much success yet).

@vefatica commented on GitHub (Jan 15, 2021): It's the delay in releasing Alt which triggers it. That is, If I release Plus right away and pause a bit, or release Plus and Shift right away and pause a bit, it happens. If I release Plus and Alt (or just Alt) right away and pause a bit, it does not happen. This is an interesting exercise in manual dexterity! I'm trying to repro with SendInput (not much success yet).
Author
Owner

@zadjii-msft commented on GitHub (Jan 15, 2021):

That's mental. It sounds like alt-tab is getting triggered, but tab isn't involved here at all.

  • does this repro with both alt keys?
  • does the focus always move to the same program (firefox/notepad), or does it alway move to the "previous" window?
  • For a truly mental repro, does it repro with the on-screen keyboard? (I suppose that'd only work on a touchscreen device)
@zadjii-msft commented on GitHub (Jan 15, 2021): That's mental. It _sounds_ like alt-tab is getting triggered, but tab isn't involved here at all. * does this repro with both alt keys? * does the focus always move to the same program (firefox/notepad), or does it alway move to the "previous" window? * For a truly mental repro, does it repro with the on-screen keyboard? (I suppose that'd only work on a touchscreen device)
Author
Owner

@vefatica commented on GitHub (Jan 15, 2021):

I have only one Alt key (left) the other one is scan-code mapped to Win.

Focus usually (?, see below) goes to whatever other app was started first, not, as a rule, to the previous window.

It does happen using the on-screen keyboard via the mouse. If the click on =/+ is quick, all's OK. If I hold the mouse button down a bit on =/+ the change of focus is triggered. And in four such experiments a moment ago, focus went to Notepad twice and to Firefox twice.

@vefatica commented on GitHub (Jan 15, 2021): I have only one Alt key (left) the other one is scan-code mapped to Win. Focus usually (?, see below) goes to whatever other app was started first, not, as a rule, to the previous window. It does happen using the on-screen keyboard via the mouse. If the click on =/+ is quick, all's OK. If I hold the mouse button down a bit on =/+ the change of focus is triggered. And in four such experiments a moment ago, focus went to Notepad twice and to Firefox twice.
Author
Owner

@vefatica commented on GitHub (Jan 15, 2021):

This will do it too. If I change the Sleep() to 300, it won't.

	INT i;
	INPUT z[6];
	for ( i=0; i<6; i++ )
	{
		z[i].type = INPUT_KEYBOARD;
		RtlZeroMemory(&z[i].ki, sizeof(KEYBDINPUT));
		if ( i > 2 )
			z[i].ki.dwFlags = KEYEVENTF_KEYUP;
	}
	z[0].ki.wVk = z[5].ki.wVk = VK_LMENU;
	z[1].ki.wVk = z[4].ki.wVk = VK_SHIFT;
	z[2].ki.wVk = z[3].ki.wVk = VK_OEM_PLUS;
	SendInput(3, z, sizeof(INPUT)); // down
	Sleep(400);
	SendInput(3, z+3, sizeof(INPUT)); // up

@vefatica commented on GitHub (Jan 15, 2021): This will do it too. If I change the Sleep() to 300, it won't. ``` INT i; INPUT z[6]; for ( i=0; i<6; i++ ) { z[i].type = INPUT_KEYBOARD; RtlZeroMemory(&z[i].ki, sizeof(KEYBDINPUT)); if ( i > 2 ) z[i].ki.dwFlags = KEYEVENTF_KEYUP; } z[0].ki.wVk = z[5].ki.wVk = VK_LMENU; z[1].ki.wVk = z[4].ki.wVk = VK_SHIFT; z[2].ki.wVk = z[3].ki.wVk = VK_OEM_PLUS; SendInput(3, z, sizeof(INPUT)); // down Sleep(400); SendInput(3, z+3, sizeof(INPUT)); // up ```
Author
Owner

@vefatica commented on GitHub (Jan 15, 2021):

Strange ... focus seems to go to the lowest window in the Z-order. Running the code from my last post, in WT, 9 times in a row, each time back to WT with a mouse click, focus changed to Firefox, Notepad, DevEnv, Firefox, Notepad, DevEnv, Firefox, Notepad, DevEnv.

@vefatica commented on GitHub (Jan 15, 2021): Strange ... focus seems to go to the lowest window in the Z-order. Running the code from my last post, in WT, 9 times in a row, each time back to WT with a mouse click, focus changed to Firefox, Notepad, DevEnv, Firefox, Notepad, DevEnv, Firefox, Notepad, DevEnv.
Author
Owner

@vefatica commented on GitHub (Jan 15, 2021):

User error again! (Bad week!) Sorry for wasting your time, Mike. The start-up script for my default shell was generating Esc (to kill the warning about the service). That, together with an Alt left over from the pane splitting, was triggering a cycle-through-the-windows KB shortcut.

@vefatica commented on GitHub (Jan 15, 2021): User error again! (Bad week!) Sorry for wasting your time, Mike. The start-up script for my default shell was generating Esc (to kill the warning about the service). That, together with an Alt left over from the pane splitting, was triggering a cycle-through-the-windows KB shortcut.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12081