Skip to content

Cannot type in new pane or tab until focus is manually activated with mouse click #13388

Open

Description

@praimmugen

Windows Terminal version

1.14.1451.0

Windows build number

10.0.19042.0

Other Software

No response

Steps to reproduce

Create new pane/new tab

Expected Behavior

It is possible to type in the newly opened terminal

Actual Behavior

Unable to type until I click on the new terminal.

Note that enabling the option "Automatically focus pane on mouse hover" partially prevents the issue from happening.

It seems like focus is removed from all terminal tabs/panes whenever a new one is created.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jun 27, 2022
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Jun 27, 2022
  3. changed the title [-]Cannot type in new pane or tab until focus is manually actived with mouse click[/-] [+]Cannot type in new pane or tab until focus is manually activated with mouse click[/+] on Jun 27, 2022
  4. lhecker commented on Jun 27, 2022

    @lhecker
    Member

    I can't reproduce this issue, unless it's an initial launch of WSL. Does your issue happen with WSL or with any shell?

  5. praimmugen commented on Jun 28, 2022

    @praimmugen
    Author

    Hey, thanks for having a look at this. At the moment I can reproduce it with both WSL and Powershell profiles. However it's a lot less consistent than I thought initially.

    It doesn't make much sense, but mostly, after starting a new terminal, new tabs/panes are working fine (apart from the initial launch of WSL as you also noticed). However, if I switch to a different window for some time (seems like around a minute is enough, but 30 seconds is not), then go back to Windows Terminal (using Alt+Tab or mouse doesn't make a difference), I can experience the issue.

    At the moment the option "Automatically focus pane on mouse hover" is disabled, so I don't think that was necessarily making any difference like I said in the initial report.

    In case it helps, I'm attaching my settings.json

    winterm-settings.json.zip

  6. jamesmcdonald commented on Jul 18, 2022

    @jamesmcdonald

    I have an issue that might be related. If I open a terminal from the Start menu in Windows 11 by typing to search for "terminal", it almost always appears under other windows and fails to get focus. If I just click on the pinned icon in the Start menu without typing, this never happens. Opening a terminal with Win-x i also gets focus correctly, as does Ctrl-Shift-n from another terminal. This seems to be consistent with both Terminal (1.13.11432.0) and Terminal Preview (1.15.1863.0).

    My default profile is WSL, in case that makes a difference. The issue affects any new windows regardless of how many terminals I have open.

  7. elouanKeryell-Even commented on Jul 26, 2022

    @elouanKeryell-Even

    same issue here, cannot seem to get the focus on a newly opened tab

  8. zadjii-msft commented on Jul 26, 2022

    @zadjii-msft
    Member

    I'm gonna focus in on the PowerShell repro case here. The fact that the Terminal loses focus when a WSL tab is opened is a well-known bug (I believe in WSLg).

    I don't have any idea why this would happen. Alemu (@praimmugen) when the terminal does get into this state (where apparently nothig is focused), what does pressing tab do? That should move focus to the "next" UI element, which might help us figure out where focus is currently.

  9. praimmugen commented on Jul 26, 2022

    @praimmugen
    Author

    when the terminal does get into this state (where apparently nothig is focused), what does pressing tab do? That should move focus to the "next" UI element, which might help us figure out where focus is currently.

    Unfortunately, pressing tab has no effect - I can't see anything getting focus no matter how many times I press the key.

    I'm gonna focus in on the PowerShell repro case here. The fact that the Terminal loses focus when a WSL tab is opened is a well-known bug (I believe in WSLg).

    Not sure it changes things, but in my case focus is also lost when opening new WSL panes within a tab.

  10. ghost added
    Needs-AttentionThe core contributors need to come back around and look at this ASAP.
    on Jul 26, 2022
  11. ghost removed
    Needs-Author-FeedbackThe original author of the issue/PR needs to come back and respond to something
    on Jul 26, 2022
  12. zadjii-msft commented on Jul 26, 2022

    @zadjii-msft
    Member

    Is there anything in your PowerShell profile? If pressing tab does nothing, then I'd suspect that maybe the Terminal HWND itself doesn't even have focus, and something else is the forground window. Maybe there's something in your profile.ps1 that's like, shelling out to WSL or something

  13. 219 remaining items

  14. DayKev commented on Jan 14, 2026

    @DayKev

    Well I wish I paid attention to what my old version was before updating, because I'm now having this issue too (or a similar issue? not sure).
    Right click in explorer -> choose "open in terminal" -> explorer window stays focused and continues to be the window receiving inputs.
    The taskbar icon for terminal continually flashes and the terminal window that opened behind the active explorer window has a blinking cursor as if it had focus... but it doesn't.

    Win10 22H2, Terminal 1.23.13503.0 (also tested the most recent 1.24 preview release via the "releases" tab on GitHub and the 1.25 canary build via the installer linked a few comments up, same behavior).

    If a terminal window is already open and "open in terminal" opens a new tab in the same window, then it focuses correctly, the issue only occurs when a new terminal window is opened via the explorer context menu.

    There's no focus change after 30s or any other amount of time, it just stays in the background (with the taskbar icon flashing) until I manually switch focus to the window.

    Terminal's default profile is set to Pwsh7 (though briefly setting it back to Pwsh5 doesn't change the behavior).

  15. KoenT-SS commented on Feb 4, 2026

    @KoenT-SS

    I can confirm this is still happening for me too on Windows 10 Pro 22H2 build 19045.6809 (latest (paid) ESU):

    right click in explorer (on a folder or on empty space) -> choose "open in terminal" -> terminal opens but explorer window stays focused and continues to be the window receiving inputs (you start typing, expecting you're typing in the terminal, but you're typing in the explorer window instead...)

    Also happens if you right click on desktop -> choose "open in terminal" for example.

    This is an annoying bug, that I run in to every single day.

    Note: this doesn't seem to happen on my other Windows machine, which is running Windows 11 Pro 25H2 build 26200.7623.

  16. jonas-jonsson commented on Feb 17, 2026

    @jonas-jonsson

    To me this bug appeared after I installed Visual Studio Community to use the C++ Toolchain. Could it be the profiles VS adds or something VS does to the registry?

    I currently suppressed it by setting HKEY_CURRENT_USER >> Control Panel >> Desktop >> ForegroundLockTimeout's value to 0, but supressing it this way is hacky, and not ideal at all.

    Win 10 Home 22H2 19045.6937

  17. KoenT-SS commented on Feb 19, 2026

    @KoenT-SS

    @adhSwede I also have Visual Studio 2022 Community Edition with the C++ toolchain installed. Might be related perhaps. Not sure if I had the issue before I installed it though (since it's the first thing I install on a new system).

    Mike Griese (@zadjii-msft) I happened to see your comment on a pull request at #19520 (comment) where you mentioned this:
    "Furthermore, #13388 has plagued us not because the terminal isn't focused, but because another application is stealing foreground from us."
    Not entirely sure if that was only focused on that specific context there, but I for sure experience this bug not as another application stealing focus, but rather as the new terminal not gaining focus when it starts. Just try this (without any other application open):

    right click in explorer (on a folder or on empty space) -> choose "open in terminal" -> terminal opens but explorer window stays focused and continues to be the window receiving inputs (you start typing, expecting you're typing in the terminal, but you're typing in the explorer window instead...)

    Also happens if you right click on desktop -> choose "open in terminal" for example.

    For some reason, the newly started terminal ("command prompt", not power shell in my case) does NOT receive the focus.

    Can you reproduce this? It's really consistent.

    Windows 10 Pro, 22H2, 19045.6937 (paid ESU).

  18. jgilles commented on Feb 19, 2026

    @jgilles

    I just tested the canary build and it is certainly a large improvement.
    Focus does appear to be lost still (the mouse cursor becomes suddenly
    visible), but it returns automatically now where before it would not return
    without clicking on the terminal. Ideally focus wouldn't be lost at
    all...but this is better -- continuing to type hides the mouse cursor again
    and no clicking is needed.

    Some noteworthy info:

    I am in a corporate environment, running Windows 11 Enterprise 22H2
    BeyondTrust Privilege Management is installed
    In both Terminal builds (canary and 1.20.11781.0) focus is lost
    approximately 35 seconds after opening a new tab
    I can type characters one at a time, approximately one second apart and
    focus is always lost after 35 seconds or so.
    I was not using WSL at the time, just launching a new tab running git bash.

    Thank you for working on this issue, it is maddening!
    …

    An update since my last comment quite a while ago (Aug 2024). I ran the canary build that was provided then for a long time since it was an improvement over the old behavior. I recently decided to try the latest official release and now the issue has completely gone away. I have zero focus issues at all. If this is some interaction with other software like Beyond Trust, maybe updates to that software since has helped? Unfortunately, I have no idea what has fixed the issue. Recent comments all mention Windows 10.

    Windows 11 Enterprise 23H2
    BeyondTrust Privilege Management (and many other corporate management/monitoring tools)
    Windows Terminal Version: 1.23.20211.0

  19. ryanmda commented on Feb 19, 2026

    @ryanmda

    Jesse Gilles (@jgilles) The current variant of the issue is that Terminal steals focus after 30 seconds instead of losing it.

  20. jgilles commented on Feb 19, 2026

    @jgilles

    Ryan Armstrong (@ryanmda) I definitely saw Terminal steal focus back when I first tried the canary build, but now I don't see that either. Terminal doesn't lose focus nor steal it.

  21. Brain2000 commented on Mar 6, 2026

    @Brain2000

    This issue only happens with windows terminal, it doesn't matter if you use cmd or powershell or wsl.
    It happens when you pin Terminal and click it or use WIN +
    It doesn't seem to happen if you click Start-> type "terminal" -> press Enter.

    UPDATE: I just found my other machine was working fine, so I compared the two until I found the difference.
    Version 1.23.20211.0 focuses just fine. The previous 1.14.xxx does not.

    As soon as I opened the windows store and pulled up the terminal app, it immediately updated.

  22. KoenT-SS commented on Mar 6, 2026

    @KoenT-SS

    This is what I'm seeing when right-clicking and then selecting Open in Terminal: terminal opens but doesn't get the focus, and you have click it before you can type:

    teminal.mp4
  23. jonas-jonsson commented on Mar 10, 2026

    @jonas-jonsson

    This is what I'm seeing when right-clicking and then selecting Open in Terminal: terminal opens but doesn't get the focus, and you have click it before you can type:

    teminal.mp4

    I second this. It's always related to open in terminal for me, opening terminal in of self doesn't trigger this behaviour, only open in terminal does.

  24. MichelJenishDev commented on Mar 26, 2026

    @MichelJenishDev

    Hi, I’d like to work on this issue. Is it still available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-WindowingWindow frame, quake mode, tearoutIssue-BugIt either shouldn't be doing this or needs an investigation.Priority-1A description (P1)Product-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions