mirror of
https://github.com/microsoft/terminal.git
synced 2026-07-09 02:26:45 +00:00
Cannot type in new pane or tab until focus is manually activated with mouse click #17812
Open
opened 2026-01-31 05:54:19 +00:00 by claunia
·
190 comments
No Branch/Tag Specified
main
dev/cazamor/patch/1.25/action-name
dev/cazamor/sui-rejuv/actions
dev/cazamor/sui-rejuv/expander-groups
user/migrie/per-window-prequel
dev/cazamor/bugfix/export-text-enter
dev/cazamor/bugfix/refresh-hyperlink-hover
dev/cazamor/sui-rejuv/profiles
dev/cazamor/selfhost/2026-06-18
dev/cazamor/sui-rejuv/profile-rejuv
dev/duhowett/onebranch-terrapin
dev/migrie/per-window-final
dev/cazamor/sui-rejuv/setting-container
dev/cazamor/toast/activity
dev/migrie/f/new-profile-subcommand
dev/cazamor/sui-rejuv/profiles-v2
dev/duhowett/asan-for-all
dev/cazamor/sui-rejuv/profiles-new
dev/cazamor/sui-rejuv/expander-groups-new
dev/cazamor/auto-save/refresh-settings
release-1.24
release-1.25
feature/llm
dev/cazamor/auto-save/model/json-manager
dev/migrie/overview-for-pr
dev/cazamor/auto-save/settings-model
dev/migrie/s/snippet-params
users/merlinbot/1es-pt-auto-baselining-pr
niels9001/inactive-tab-foreground
dev/cazamor/selfhost/2026-05-20-home
dev/duhowett/fzf-vcxproj
dev/cazamor/selfhost/2026-05-20
dev/cazamor/selfhost/2026-05-19
dev/cazamor/selfhost/2026-05-18
niels9001/fontweight-fixes
niels9001/page-transitions
dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring
dev/duhowett/fhl-2026/remove-paste-hairpin-handler
dev/migrie/f/overview-view
dev/cazamor/selfhost/2026-05-13
dev/cazamor/selfhost/2026-05-13-sui
dev/yeelam/f/BuildTest
dev/duhowett/hax/our-own-tabview
dev/cazamor/bugfix/close-scratchpad
dev/cazamor/selfhost/2026-05-05
dev/cazamor/selfhost/2026-05-04-workspaces
dev/cazamor/selfhost/2026-05-04
dev/duhowett/win7-wpf-termcontrol-squash
dev/lhecker/20149-hotfix
dev/lhecker/osc-7-wsl
dev/lhecker/19977-kkp-altgr
dev/migrie/workspaces-real
dev/migrie/fhl-spring-2026/quake-4
dev/lhecker/pwsh-5.1
dev/cazamor/sui/dropdown-page
dev/cazamor/selfhost/2026-04-08
dev/cazamor/selfhost/2026-04-06
dev/migrie/fhl-spring-2026/confirmCloseOn
dev/cazamor/confirmCloseOn/dont-ask-me-again
dev/lhecker/inproc-conpty
dev/duhowett/powershell-module-supercharger
dev/cazamor/a11y/vt-seq-prototype
dev/migrie/fhl-spring26/osc777-2
dev/migrie/fhl-spring26/2/notification-infrastructure
dev/migrie/fhl-spring-2026/side-tabs
dev/cazamor/copilot/playground
dev/migrie/fhl-spring-2026/quake-3.5
dev/migrie/fhl-spring26/osc777
dev/migrie/fhl-spring26/unpackaged-notify
dev/migrie/fhl-spring26/bellStyle-notification
dev/migrie/fhl-spring26/activity-notifications
dev/migrie/fhl-spring-2026/x-open
dev/migrie/fhl-spring-2026/quake-5
dev/migrie/fhl-spring26/nextTab-filter
dev/duhowett/atlas-draw-d2d-dots-curlies-consistently
dev/lhecker/14165-conhost-font-size
dev/lhecker/ottosson-by-default
dev/duhowett/hax/unix-pty
dev/duhowett/hax/cmake
dev/lhecker/generate-256-colors
dev/lhecker/dcs-perf
dev/lhecker/1410-large-scrollback
dev/cazamor/selfhost/2026-02-10
dev/lhecker/11509-kitty-keyboard-protocol-wip
dev/cazamor/selfhost/2026-01-29
dev/lhecker/benchcat-fix
dev/duhowett/eoy-25/allow-set-foreground
release-1.23
dev/cazamor/bot/deprecate-area-atlasengine
dev/cazamor/selfhost/2026-01-20
dev/cazamor/selfhost/2026-01-12
dev/cazamor/spec/auto-save
dev/duhowett/fhl-2024/asciicast-recorder
dev/duhowett/eoy-25/underline-colors-in-atlas-bug
dev/duhowett/hax/serial-port-support
dev/duhowett/connection-utf8
dev/lhecker/fused-event
dev/lhecker/18928-wip
dev/duhowett/fhl-2024/clang
dev/duhowett/vt-cache-changes
dev/cazamor/uia-leak
release-1.22
dev/cazamor/selfhost/11-18-v3
dev/cazamor/selfhost/11-18
dev/duhowett/fhl-2025/bitmap-fonts
dev/duhowett/server-2025-vms
dev/duhowett/cant-believe-gotta-do-this-shit
dev/lhecker/dark-mode
dev/cazamor/sui/invert-cursor-color
dev/duhowett/fhl-2025/wt-command-palette-cmdpal-integration
dev/duhowett/fhl-2025/wt-json-relative-icons
dev/lhecker/fucking-service-locator
dev/duhowett/unicode-17
dev/duhowett/multi-blern
dev/lhecker/wellp2-alt
dev/duhowett/wellp2
dev/lhecker/1860-horizontal-scrollbar
dev/lhecker/fix-window-count
dev/cazamor/sui/tab-color-old
dev/duhowett/hax/conhost-icon
dev/duhowett/hax/sui-color-chip-border
dev/duhowett/hax/terminalsettings-as-a-lib-/with-types-merged-into-tsm
dev/pabhoj/page_control_input_cleanup
dev/duhowett/padding-in-atlas-rebase-20250729
dev/lhecker/attach-thread-input
dev/duhowett/portable-shader-members
msbuildcache-reenable
dev/cazamor/selfhost/1.24-2025-06-10
dev/cazamor/upgrade-settings-containers
dev/cazamor/sui/ext-page/powershell-stub
dev/cazamor/selfhost/1.24-2025-05-15
dev/pabhoj/sui_action_overhaul
dev/cazamor/selfhost/1.24-2025-05-06
dev/cazamor/selfhost/1.24-2025-04-29
dev/cazamor/sui/ext-page/lazy-load-objects
dev/cazamor/sui/ext-page/badge
dev/cazamor/selfhost/1.24
dev/lhecker/sdk-26100
dev/duhowett/testing
dev/jadelaga/VS-Pty.Net-1.22
dev/duhowett/fhl-2025/what-if-no-content-ids
dev/lhecker/18584-part2
dev/lhecker/get-lang-id
dev/duhowett/hax/clogs
release-1.21
dev/pabhoj/featurellm_fix_paste
dev/lhecker/grapheme-backup
dev/jadelaga/VS-Pty.netFixes
dev/lhecker/atlas-engine-compute-shader
dev/migrie/s/ai-providers
dev/lhecker/animated-cursor-wip
dev/pabhoj/featurellm_timeout
dev/lhecker/dark-mode-alt
dev/duhowett/osc-strided-table
dev/lhecker/bugbash
dev/pabhoj/featurellm_improve_parsing
dev/duhowett/coast-to-coast
dev/lhecker/curly-improvements
dev/duhowett/net8
dev/duhowett/onebranch-custom-pool
dev/lhecker/renderer-overhaul-2nd-attempt
dev/lhecker/cleanup
dev/cazamor/sui/confirmation-announcements
dev/lhecker/theme-quality
dev/lhecker/winconpty-cleanup
dev/duhowett/learn/rewrite-highlights
dev/migrie/b/no-nesting-when-searching
release-1.20
dev/duhowett/sel-2-spans
dev/lhecker/7118-cursor-color
dev/lhecker/remove-glyph-width
dev/lhecker/igfw-scroll-region
dev/lhecker/17656-win32im-double-encoding
dev/duhowett/fhl-2024/merge-idls
dev/duhowett/feed-forward-variables
dev/lhecker/remove-chrome-math
dev/duhowett/copylink
dev/duhowett/applicableactions
gh-readonly-queue/main/pr-17566-de50310295b7d92ed3d51f07974a2a945776bf9d
dev/lhecker/atlas-engine-stride-copy
dev/migrie/b/bump-nuget-in-c
dev/migrie/f/992-redux-redux
dev/migrie/f/filter-weight-input-too
dev/migrie/f/disable-nesting
dev/migrie/f/local-snippets-cleaner
dev/migrie/s/1553-mouse-bindings
selfhost-1.22-bugbash-2024-06-04
selfhost/1.22-bugbash-2024-06-04
dev/lhecker/15689-tab-drag-crash-fix
dev/migrie/f/sxnui-font-size-change
dev/migrie/f/local-snippets-on-action-refactor
dev/migrie/f/just-local-snippets
dev/migrie/save-input-patches
dev/migrie/f/md-pane-official
dev/migrie/base-pane
dev/migrie/fhl/tasks-pane
release-1.19
dev/migrie/b/17130-clear-marks-2
dev/migrie/b/17075-its-me-the-killer
dev/duhowett/i-figured-out-why-sometimes-the-publish-build-failed
dev/duhowett/nuget-publication-with-aad-app-id
selfhost-1.20
dev/duhowett/graph
dev/migrie/b/15803-activate-dont-copypasta
dev/duhowett/is-pgo-broken-because-of-sui-being-slower
dev/migrie/b/remove-terminaltab
dev/migrie/fhl/md-pane
dev/migrie/fhl/local-tasks-2024
dev/migrie/fhl/2024-inline-notebook
dev/duhowett/interface-projects
dev/duhowett/dead-loc
release-1.18
dev/migrie/fhl/2024-spring-merge-base
dev/duhowett/hax/l9
inbox
dev/migrie/14073-on-main
dev/duhowett/hax/conhost_dump_replay
user/lhecker/atlas-engine-srgb
dev/migrie/fhl/sxnui-tooltips-3
dev/migrie/7718-notifications-experiments
dev/migrie/fhl/7718-notifications
dev/migrie/fhl/7718-notifications-reboot
dev/lhecker/remove-gsl
dev/lhecker/16575-TerminateProcess
dev/lhecker/window-thread-climate-control
dev/lhecker/client-context-input-output-mode
dev/lhecker/ring-buffer-input-buffer
release-1.17
dev/lhecker/propsheet-fontdlg-refactor
dev/lhecker/renderer-overhaul
dev/pabhoj/test
dev/duhowett/chop
dev/lhecker/til-ulong-cleanup
dev/lhecker/til-env-cleanup
dev/migrie/f/16005-a11y-pane
dev/cazamor/a11y/fastpass
dev/migrie/b/15487-push-cwd
dev/migrie/b/15536-or-15219-idk
dev/duhowett/move-timers-down-into-core-interactivity-etc
dev/migrie/b/15812-broadcast-paste-two
dev/migrie/fhl-fall-2023/11162-quake-III-arena
dev/migrie/fhl-fall-2023/1620-automatic-tab-progress
dev/migrie/fhl-fall-2023/9992-quake-II
dev/migrie/fhl-fall-2023/9992-default-quake-settings
dev/migrie/fhl-fall-2023/9992-window-name-settings
dev/migrie/fhl-fall-2023/oceans
dev/lhecker/ColorScheme-improvements
dev/migrie/search-v2-v3
dev/migrie/pr-15717/its-dangerous-to-go-alone
dev/migrie/f/4768-taskbar-icons
dev/duhowett/padding-in-atlas
dev/migrie/f/3121-tooltips
dev/duhowett/sticky-control
dev/duhowett/fix-tracing-2
dev/migrie/b/add-support-for-vsc-marks
dev/migrie/f/1860-this-is-literally-what-less-is-for
dev/migrie/s/5916-draft
dev/lhecker/tracy
dev/migrie/s/north-star
dev/cazamor/tag-youre-it
dev/migrie/f/12336-let-it-mellow
dev/migrie/f/now-with-more-compat-settings
dev/migrie/f/compatibility-sui
dev/duhowett/hax/wpf-atlas
dev/duhowett/fgb
dev/migrie/b/15487-relative-paths-are-hard
dev/lhecker/colrv1
loc-update
dev/migrie/fhl/dyndep-csharp
dev/migrie/fhl/dyndep
dev/migrie/fhl-clickable-send-input
dev/migrie/f/cwd-hijinks-5506-15173
dev/lhecker/openconsole-async-start
1.17
dev/migrie/bump-scratch
dev/migrie/f/3726-restartConnection
dev/migrie/b/cxn-restarting-attempt-1-backport
dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing
dev/migrie/b/13388-focus-logger
dev/migrie/b/9053-part-4-i-guess-defterm
dev/migrie/oop/3/of-the-silmarils
of-the-darkening-of-valinor
dev/migrie/fhl/notebook-proto-000
dev/migrie/f/narrator-buddy
dev/migrie/mux-2.8.2-march-2023
dev/migrie/f/roast-mutton
dev/migrie/f/12861-preview-input
dev/lhecker/clang-tidy
dev/migrie/f/3121-wE-dOnT-hAvE-dEv-DaYs
dev/duhowett/compiler-compliance
dev/duhowett/i-have-a-burning-hatred-for-ntstatus-of-later-so-why-not-fix-it
dev/duhowett/shorthand-namespaces
dev/duhowett/rename-all-dlls
dev/duhowett/errordialog
dev/lhecker/gsl-narrow
dev/migrie/b/11522-dumb-idea
release-1.16
dev/miniksa/env
dev/duhowett/hax/embed-everything
dev/migrie/b/13388-attempt-003
dev/migrie/b/14512-test-research
dev/migrie/b/13388-attempt-002
dev/migrie/b/14464-copyOnSelect-moving-text
dev/migrie/s/thema-schema-for-1.16
dev/migrie/s/theme-pair-schema
dev/migrie/b/13388-experiments-1
dev/cazamor/spec/a11y-vt-seq
dev/migrie/b/14557-empty-folder-dropdown
dev/cazamor/spec/a11y-vt-seq-v2
release-1.15
dev/migrie/f/process-model-v3-test-0
dev/lhecker/vsconfig
dev/migrie/s/5000-presentation
dev/lhecker/5907-startup-perf
dev/lhecker/winrt-file-api-benchmark
dev/duhowett/128-bit-compiler
dev/duhowett/hax/arm64-native-build
dev/migrie/fhl/more-shell-integration
dev/migrie/b/13388-experiments-0
dev/lhecker/til-to-ulong-improvements
dev/migrie/s/markdown-notebooks
dev/cazamor/a11y/nav-by-page
dev/cazamor/a11y/system-menu-support
dev/duhowett/no-private-registry-keys
dev/cazamor/wpf/uia-expose-enable-events
dev/cazamor/wpf/uia-events
extendAISpec
dev/migrie/fhl/clickSendInput
dev/migrie/fhl/save-command
dev/migrie/b/theme.profile
dev/migrie/b/13943-a-test-for-this
dev/migrie/oop/2/endgame
dev/duhowett/hax/merge_idl
dev/migrie/oop/2/infinity-war
dev/migrie/spellbot-cve
dev/cazamor/a11y-sev3/new-profile-announcement
dev/migrie/fhl/upside-down-mode
release-1.14
dev/migrie/f/9458-startupInfoToTerminal
dev/migrie/fhl/5916-triggers
dev/migrie/b/13523-context-menu
dev/migrie/b/6523-endpaint-outside-lock
dev/migrie/b/12413-OnUnhandledException
dev/lhecker/render-snapshot
dev/cazamor/1.15/scroll-to-point
dev/migrie/mux-2.8-aug-2022
dev/lhecker/lock-console-guard
dev/migrie/f/1504-final
dev/pabhoj/sui_follow_ups
dev/migrie/f/til-winrt.h
dev/cazamor/color-picker-redesign
dev/migrie/fhl/vscode-autocomplete-prototype
dev/migrie/f/1504-prototype
dev/migrie/oop/2/loki
dev/migrie/oop/2/wandavision
dev/migrie/b/8698-YOURE-OUT-OF-ORDER
fabricbot-configuration-migration
dev/migrie/b/12788-did-it-work
dev/migrie/b/localtests-ci-2022
dev/cazamor/1.14/replace-compareInBounds
dev/pabhoj/preview_string
dev/cazamor/ks/switchSelectionEndpoint
dev/migrie/oop/2/COM-ISwapChainProvider-attempt-1
dev/migrie/b/dxd-marker
release-1.13
dev/migrie/b/13066-for-defterm
dev/cazamor/revert-dwm
dev/migrie/b/13066-sw_flash_repeatedly
dev/migrie/b/no-cloaky-cloak
dev/migrie/f/apples-to-oranges
dev/migrie/f/no-custom-caption-btns
dev/migrie/f/10509-mica-and-transparent-titlebars
dev/migrie/b/12911-wpf-focus-fg
dev/migrie/titebar-colors
dev/lhecker/4015-cursor
dev/migrie/fhl/rgb-rainbow-window-frame
dev/migrie/fhl/scroll-marks-prototype
release-1.12
dev/miniksa/compliance
dev/migrie/f/default-icons
dev/migrie/fhl/10175-web-search-for-text
dev/migrie/fhl/menu-complete-prototype
dev/migrie/b/2988-merged-prototypes
dev/migrie/b/2988-niksa-msgs-prototype
dev/migrie/fhl/9583-colorSelection
dev/migrie/b/10609-sui-leak
dev/migrie/b/32-attempt-3
dev/migrie/release-1.12-rejuv-attempt-2
dev/migrie/demo-for-presentation
dev/migrie/b/32-but-im-here-for-12567
dev/duhowett/conpty_first_frame_blug
dev/migrie/b/11092-unfocused-acrylic-settings
dev/migrie/localtests-in-ci
dev/migrie/b/12356-attempt-2
dev/migrie/b/12353-with-null
dev/migrie/b/12387-trim-spaces
dev/migrie/b/5033-bad-start
dev/lhecker/12351-broken-locales
dev/migrie/b/8663-input-to-oem-crash
dev/migrie/b/11743-win10-opacity-is-hard
dev/migrie/f/ctrl-click-elevate
dev/migrie/b/12196-shim-localization
dev/lhecker/issue-4015-til-rect
dev/cazamor/eim/mvvm
dev/migrie/f/--elevate
dev/migrie/b/11668-i-think
dev/migrie/b/11994-wsl-mangline
dev/migrie/eim/3475-action-xmacros
dev/migrie/eim/incremental-build-000
dev/cazamor/a11y/fake-uia-data
dev/migrie/f/non-terminal-content-elevation-warning
dev/migrie/f/632-on-warning-dialog
dev/lhecker/rgba
dev/migrie/b/8480-keybindings-in-tabs
release-1.11
dev/migrie/b/11561-dead-ends
dev/migrie/oct-21-roadmap-update
dev/migrie/fhl/adaptive-card-extension
dev/cazamor/test/11440
dev/migrie/f/warning-dlg-automation
dev/migrie/b/1.12-crash-on-exit
dev/migrie/b/11146-next-tab-in-cmdpal
release-1.10
dev/migrie/5ff9a24-and-75e2b5f
dev/duhowtt/hax/cpal-jumplist-async
dev/lelian/actionid/1
dev/migrie/f/just-elevated-state
dev/lhecker/terminal-settings-cleanup
dev/migrie/gh-10824
dev/pabhoj/cursor_light
dev/migrie/oop/wandavision
dev/migrie/oop/endgame
dev/migrie/oop/infinity-war
dev/lhecker/app-state-actually-hidden
dev/migrie/b/6160-dynamic-default-warning
dev/mgirie/b/more-nchhittest-ideas
dev/migrie/b/9320-interfacial-separation
cinnamon/fhl/find-contextmenu
dev/lhecker/wsl-distro-generator-cleanup
dev/migrie/b/10875-but-more-clever
dev/migrie/b/broken-globalsummon-overloading
dev/duhowett/hax/rle-row
dev/migrie/fhl-2021/cmdpal-select-list
dev/migrie/fhl-2021/differential-pixel-shading
dev/duhowett/hax/no-writable-glyphat
dev/migrie/fhl-2021/more-shader-variables
dev/migrie/titlebar-shenannigans
dev/miniksa/win10_font_matching
dev/lhecker/conhost-oom
dev/migrie/b/10332-less-snappy-scrolling
dev/migrie/b/7422-1px-top-border
release-1.9
dev/cazamor/move-scratch
release-1.8
dev/miniksa/manifest_2
release-1.6
release-1.7
dev/migrie/oop/the-whole-thing
dev/migrie/oop/connection-factory
dev/migrie/f/quake-dropdown-2
dev/miniksa/rle2
dev/migrie/f/quake-toCurrent-experiments-2
dev/migrie/f/quake-toCurrent-experiments
dev/migrie/f/quake-dropdown
dev/cazamor/actions-page/template
dev/duhowett/hax/cursor_stamp_foreground_background
dev/migrie/f/1860-hey-might-was-well-hack-during-a-hackathon
dev/migrie/oop-terminal.control-split-control
dev/duhowett/hax/build-with-wholearchive
dev/cazamor/spec/tsm-actions-temp
dev/migrie/oop-tear-apart-control
dev/migrie/oop-scratch-3
dev/cazamor/sui/bugfix-reload-crash
dev/migrie/f/xmacro
dev/cazamor/sui/proto/profile-nav-view
dev/migrie/f/name-windows
dev/migrie/dol/messing-with-shaders-take-1
release-1.5
dev/cazamor/sui/inheritance-hyperlinks-test
dev/migrie/r/commandline-lib-002
dev/migrie/f/com.fabrikam.toaster
dev/cazamor/adaptive-cards-prototype
dev/migrie/f/commandline-lib
dev/miniksa/zipzoom2
dev/migrie/f/remote-commandlines
dev/migrie/f/632-elevated-profiles
dev/migrie/oop-broker-000
dev/migrie/fix-pr-7015
dev/duhowett/clang
dev/miniksa/input_tests_2
dev/miniksa/input2
dev/migrie/oop-rpc-000
release-1.4
dev/migrie/oop-mixed-elevation-1
dev/migrie/oop-window-content-1
cinnamon/open-json
dev/miniksa/input_tests
dev/duhowett/hax/tsm-graphviz
dev/miniksa/input
dev/duhowett/hax/caption_buttons
release-1.3
dev/cazamor/a11y/expand-line-under-viewport
dev/cazamor/acc/ch/word-nav-perf
dev/cazamor/spec/settings-ui-architecture-draft
dev/duhowett/hax/tap_upgrade
dev/migrie/f/pane-exit-animation
release-1.2
dev/migrie/move-lib-up-and-dll-down
release-1.1
dev/migrie/f/branch-2-backup
dev/migrie/f/settings-getters-only
dev/duhowett/hax/command_palette_search
dev/migrie/f/6856-let-terminalpage-expandcommands
dev/migrie/f/theming-2020
dev/migrie/oop-scratch-4
dev/duhowett/hax/punchout
dev/migrie/s/action-ids
dev/migrie/f/lets-just-generate-these
dev/migrie/oop-scratch-2
dev/miniksa/dcomp
dev/miniksa/gotta_go_fast_spsc
dev/miniksa/gotta_go_fast
dev/miniksa/perf_skip_checks
dev/miniksa/perf_buffer_dig
dev/migrie/s/1203-cursorTextColor
dev/migrie/f/fix-intellisense-i-guess-backup
release-1.0
dev/migrie/f/execute-commandlines
dev/migrie/f/2046-Command-Palette-v2
dev/migrie/b/6421-passthrough-alt
dev/migrie/b/moving-focus-is-hard
dev/miniksa/set
dev/migrie/f/1203-phase-1
dev/migrie/f/get-localtests-in-ci
dev/cazamor/drag-panes
dev/cazamor/tile-background
release-0.11
dev/duhowett/dev/duhowett/hax/appstate_remember
dev/duhowett/hax/wpf_win_8_hax
dev/migrie/b/3088-weird-exact-wrap-resize
release-0.10
dev/migrie/b/4591-custom-scaling-bug
dev/duhowett/hax/attr_smuggling
dev/migrie/b/5161-mingw-vim-fix
dev/miniksa/dx_bitmap
dev/migrie/b/1503-try-messing-with-cooked-read
dev/duhowett/eyebeam
dev/migrie/b/5113-experiments
dev/duhowett/hax-selection-exclusive
dev/migrie/f/more-vt-renderer-tracing
dev/miniksa/bitmap
dev/duhowett/wprp
dev/miniksa/bitmap-mad-with-power
dev/migrie/f/resize-quirk
dev/migrie/f/reflow-buffer-on-resize-002
wpf-renderer-revert
dev/miniksa/draw
release-0.9
dev/miniksa/tabs-color-fix
dev/miniksa/4309
dev/migrie/f/just-wrapping
dev/migrie/b/3490-try-another-resize-algo
release-0.8
dev/migrie/b/3490-a-simpler-resize
dev/migrie/b/3490-resize-down
dev/miniksa/4254
dev/migrie/f/conpty-wrapped-lines-2
dev/migrie/b/be-better-at-hiding
dev/migrie/f/3327-xaml-theming-proto
dev/miniksa/gardening2
release-0.7
dev/duhowett/conpty-flags
dev/migrie/f/603-vintage-opacity
dev/migrie/PR#3181-comments
dev/duhowett/font-64
release-0.5
dev/migrie/b/663-paste-lf-always
dev/migrie/b/2011-reordered-fallthrough-strings
dev/migrie/b/411-init-tab-stops
dev/migrie/b/json-patching-is-hard
dev/migrie/b/2455-try-getting-tests-working
dev/migrie/b/1223-change-256-table
dev/migrie/f/2171-openterm.cmd
dev/migrie/f/drag-panes
dev/migrie/f/2046-command-palette
release-0.3
dev/miniksa/manager
dev/migrie/f/non-terminal-panes
dev/migrie/f/passthrough-2019
dev/miniksa/shared_pch
dev/migrie/f/1897-less-duplicated-work
release-0.2
dev/cazamor/mcs/viewport-selection
dev/duhowett/version_hack
v1.25.1322.0
v1.24.11321.0
v1.25.1241.0
v1.25.1171.0
v1.25.923.0
v1.24.10921.0
v1.25.622.0
v1.24.10621.0
v1.24.10212.0
v1.23.20211.0
v1.24.3504.0
v1.23.13503.0
v1.24.2812.0
v1.23.12811.0
v1.24.2682.0
v1.23.12681.0
v1.24.2372.0
v1.23.12371.0
v1.23.12102.0
v1.22.12111.0
v1.23.11752.0
v1.22.11751.0
v1.22.11141.0
v1.23.11132.0
v1.23.10732.0
v1.22.10731.0
v1.21.10351.0
v1.22.10352.0
v1.23.10353.0
v1.22.3232.0
v1.21.3231.0
v1.22.2912.0
v1.21.2911.0
v1.22.2702.0
v1.21.2701.0
v1.22.2362.0
v1.21.2361.0
v1.21.1772.0
v1.20.11781.0
v1.21.1382.0
v1.20.11381.0
v1.21.1272.0
v1.20.11271.0
v1.20.11215.0
v1.19.11213.0
v1.20.10822.0
v1.19.10821.0
v1.20.10572.0
v1.19.10573.0
v1.20.10303.0
v1.19.10302.0
v1.18.10301.0
v1.20.10293.0
v1.19.10292.0
v1.18.10291.0
v1.18.3181.0
v1.19.3172.0
v1.19.2831.0
v1.18.2822.0
v1.19.2682.0
v1.18.2681.0
v1.18.1462.0
v1.17.11461.0
v1.18.1421.0
v1.17.11391.0
v1.17.11043.0
v1.16.10261.0
v1.17.1023
v1.16.10231.0
v1.15.3465.0
v1.16.3463.0
v1.15.2712.0
v1.15.2874.0
v1.16.2641.0
v1.16.2523.0
v1.15.2524.0
v1.15.2282.0
v1.14.2281.0
v1.14.1962.0
v1.15.2002.0
v1.15.2001.0
v1.15.1862.0
v1.14.1861.0
v1.14.1451.0
v1.14.1432.0
v1.13.11431.0
v1.13.10983.0
v1.12.10982.0
v1.13.10733.0
v1.12.10732.0
v1.13.10395.0
v1.12.10393.0
v1.13.10336.0
v1.12.10334.0
v1.12.3472.0
v1.11.3471.0
v1.12.2931.0
v1.12.2922.0
v1.11.2921.0
v1.11.2731.0
v1.10.2714.0
v1.11.2421.0
v1.10.2383.0
v1.10.1933.0
v1.9.1942.0
v1.9.1523.0
v1.8.1521.0
v1.9.1445.0
v1.8.1444.0
v1.8.1092.0
v1.7.1091.0
v1.8.1032.0
v1.7.1033.0
v1.7.572.0
v1.6.10571.0
v1.5.10411.0
v1.6.10412.0
v1.6.10272.0
v1.5.10271.0
v1.5.3242.0
v1.4.3243.0
v1.5.3142.0
v1.4.3141.0
v1.4.2652.0
v1.3.2651.0
v1.3.2382.0
v1.2.2381.0
v1.1.2233.0
v1.2.2234.0
v1.1.2021.0
v1.2.2022.0
v1.1.1812.0
v1.0.1811.0
v1.1.1671.0
v1.0.1401.0
v0.11.1333.0
v0.11.1251.0
v0.11.1191.0
v0.11.1111.0
v0.11.1121.0
v0.10.781.0
v0.10.761.0
v0.9.433.0
v0.8.10261.0
v0.8.10091.0
v0.7.3451.0
v0.7.3382.0
v0.7.3291.0
v0.7.3252.0
v0.6.3181.0
v0.6.2951.0
v0.6.2911.0
v0.5.2762.0
v0.5.2761.0
v0.5.2681.0
v0.5.2661.0
v0.3.2321.0
v0.4.2342.0
v0.4.2382.0
v0.3.2171.0
v0.3.2142.0
v0.2.1831.0
v0.2.1715.0
v0.2.1703.0
v0.1.1621.0
v0.1.1581.0
v0.1.1502.0
v0.1.1431.0
v0.1.1361.0
v0.1.1093.0
v0.1.1161.0
v0.1.1204.0
experiment-master
v0.1.1025.0
experiment-OutsideBuild
broken-tabstops
RS2-final
v0.1.1002.0
experiment-rel-windows-inbox
experiment-f-ServerApp
v0.1.1211.0
1904.29002
1810.02002
1708.14008
Labels
Clear labels
⛺ Reserved
A11yCO
A11yMAS
A11ySev1
A11ySev2
A11ySev3
A11yTTValidated
A11yUsable
A11yVoiceAccess
A11yWCAG
Area-Accessibility
Area-AtlasEngine
Area-AzureShell
Area-Build
Area-Build
Area-Chat
Area-CmdPal
Area-CodeHealth
Area-Commandline
Area-CookedRead
Area-DefApp
Area-Extensibility
Area-Fonts
Area-GroupPolicy
Area-i18n
Area-Input
Area-Interaction
Area-Interop
Area-Localization
Area-Output
Area-Performance
Area-Portable
Area-Quality
Area-Remoting
Area-Rendering
Area-Schema
Area-Server
Area-Settings
Area-SettingsUI
Area-ShellExtension
Area-ShellExtension
Area-ShellExtension
Area-Suggestions
Area-Suggestions
Area-TerminalConnection
Area-TerminalControl
Area-Theming
Area-UserInterface
Area-VT
Area-Windowing
Area-WPFControl
AutoMerge
Blocking-Ingestion
Culprit-Centennial
Culprit-WinUI
Disability-All
Disability-Blind
Disability-LowVision
Disability-Mobility
External-Blocked-WinUI3
Fixed
Gathering-Data
good first issue
HCL-E+D
HCL-WindowsTerminal
Help Wanted
Impact-Compatibility
Impact-Compliance
Impact-Correctness
Impact-Visual
In-PR
InclusionBacklog
InclusionBacklog-Windows TerminalWin32
InclusionCommitted-202206
Issue-Bug
Issue-Docs
Issue-Feature
Issue-Feature
Issue-Question
Issue-Samples
Issue-Scenario
Issue-Task
Needs-Attention
Needs-Author-Feedback
Needs-Bisect
Needs-Discussion
Needs-Repro
Needs-Tag-Fix
Needs-Tag-Fix
Needs-Triage
No-Recent-Activity
Priority-0
Priority-1
Priority-2
Priority-3
Product-Cmd.exe
Product-Colortool
Product-Colortool
Product-Colortool
Product-Conhost
Product-Conpty
Product-Meta
Product-Powershell
Product-Terminal
Product-WSL
pull-request
Resolution-Answered
Resolution-By-Design
Resolution-Duplicate
Resolution-External
Resolution-Fix-Available
Resolution-Fix-Committed
Resolution-No-Repro
Resolution-Won't-Fix
Severity-Blocking
Severity-Crash
Severity-DataLoss
spam
this-will-be-a-breaking-change
Tracking-External
WindowsTerminal_Win32
Work-Item
zAskModeBug
zInbox-Bug
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/terminal#17812
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @praimmugen on GitHub (Jun 27, 2022).
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.
@lhecker commented on GitHub (Jun 27, 2022):
I can't reproduce this issue, unless it's an initial launch of WSL. Does your issue happen with WSL or with any shell?
@praimmugen commented on GitHub (Jun 28, 2022):
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
@jamesmcdonald commented on GitHub (Jul 18, 2022):
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.
@elouanKeryell-Even commented on GitHub (Jul 26, 2022):
same issue here, cannot seem to get the focus on a newly opened tab
@zadjii-msft commented on GitHub (Jul 26, 2022):
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. @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.
@praimmugen commented on GitHub (Jul 26, 2022):
Unfortunately, pressing
tabhas no effect - I can't see anything getting focus no matter how many times I press the key.Not sure it changes things, but in my case focus is also lost when opening new WSL panes within a tab.
@zadjii-msft commented on GitHub (Jul 26, 2022):
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
@praimmugen commented on GitHub (Jul 27, 2022):
Nothing in my PS profile, it's completely empty.
Long shot, but I also tried stopping a few apps that were running in background (things like AltDrag, AutoHotkey scripts, X server and several others), but unfortunately it didn't help.
@zadjii-msft commented on GitHub (Aug 1, 2022):
I WONDER.
I wonder if this is another facet of #13589. Like, if the WS_TOOLWINDOW created by conpty becomes the foreground window for some reason? It absolutely never should, it's not visible but... clearly there's something weird happening. Maybe this is a clue as to why on Windows 10 the taskbar seems to think that it should restore the hidden window first. Maybe that's why we can't repro this either, we're checking on Windows 11. Hmm.
NOTE TO SELF: Assigning to myself to investigate on the Win10 VM to see if I can't repro this.
Also use as an opportunity to double check the taskbar code, and see what heuristic they're using, and why it thinks the conpty window is the one it should operate on.
@matthuisman commented on GitHub (Aug 9, 2022):
I have similar issue, but only using command prompt in terminal.
Does not get focus. Need to click to allow typing
Multiple laptops at my company have same issue - so it may be something they have installed...
@enlavin commented on GitHub (Aug 9, 2022):
I'm experiencing a similar issue too, no matter if I use powershell, cmd or WSL. The window does not accept input and is not reacting to other window manager shortcuts like Win-Down/Win-Up to minimize/maximize the window. Alt-Space opens a context menu at the top-left of the active screen, if that's of any help. I have tried with and without Powertoys and the behavior is the same for me.
I have also identified 3 ways to restore the focus to the terminal window:
@jimmunn commented on GitHub (Aug 15, 2022):
I see the exact behavior @enlavin reported, including the 3 ways to restore focus. It's pretty odd that alt-F4 doesn't close the app but does give my keyboard focus in the open tab. It seems like some other executable is getting focus and alt-F4 kills that executable and that sets focus to Terminal.
I am using Windows 10: 19044.1826
Windows Terminal Version: 1.14.1962.0
My default profile is Command Prompt
@kh185193 commented on GitHub (Aug 18, 2022):
I have been having the same issue for a while now. My default terminal is WSL (Ubuntu), but I see the same occur with Powershell and Command Prompt.
New windows and tabs have no focus before mouse click. After the mouse click I can
alt+tabbetween that window and other applications with focus acting as expected. Creating a new tab on the now focused window will return the window to its unfocused state and require a further mouse click to regain it.The only functions that seem to work on the new window (before focusing with a mouse click) are
alt+f4and minimising the window withwin+down.win+upwill not maximise the window when open, or re-open the window when recently minimised either.Weirdly minimising the window with
win+downthen usingalt+tabto open again gives the window focus again. New tabs in this window will work also. I may edit my terminal hotkey to do this for me in the meantime.@codewzrd commented on GitHub (Aug 29, 2022):
I'm experiencing the same behavior on version 1.14.2281.0. In my case, this applies to all profiles, Command Prompt, Powershell (pwsh), Ubuntu (WSL). None of the Windows keyboard shortcuts work for me.
When creating a new tab with any profile, the cursor does not blink till the tab gets focus.
I get focus in the new tab when i press
Alt-F4.@spootle commented on GitHub (Aug 31, 2022):
Adding to the list of people with identical symptoms, with the added note that having acrylic material in the tab row enabled makes it more obvious that the entire Terminal app appears to lose focus (new tab makes the tab row go opaque,
Alt+F4kills the invisible window that is spawned at the top left of the window space and Terminal gets focus / tab row goes translucent@hassec commented on GitHub (Sep 4, 2022):
I have the problem on Windows 10 that opening a new terminal won't focus the terminal.
But I also noticed the following that I though might be helpful:
using AutoHotkey's Window Spy when launching a new windows terminal instance I see it reporting that focus is on:
So If I create a hotkey like this:
I can use
Win + tto launch windows terminal and I can directly start typing as focus is correctly in the terminal because the PseudoConsoleWindow was closed.@zadjii-msft commented on GitHub (Sep 6, 2022):
🐉 HERE BE DRAGONS 🐉
I wouldn't do the above post(s) and close the
PseudoConsoleWindow. That might just work for now as a workaround for this bug, but could lead to all sorts of weird behavior in the future. It might lead to crashes, or APIs not working right. I know in the past mingw has taken a dependency on that HWND's existence.As much as it might seem like a viable workaround now, I'd much rather just fix the root cause, than have people try and close that window. I'm gonna collapse comments suggesting to do that for this reason. I don't know why yet the PseudoConsoleWindow is showing up as something that can steal focus (and even be closed in the first place!), but don't go closing it.
@telb99 commented on GitHub (Oct 13, 2022):
Having this same problem on one computer, not on another.
v1.15.2524.0
Consistently works as expected on my personal computer, Windows 10 latest patches.
Consistently needs manual focus with mouse click on the work computer, managed Windows 10.
The normal Windows keys to resize/move the main Terminal app do not work until I click it with the mouse.
New Terminal windows, tabs, and panes opened within Terminal always need to be manually focused and its driving me nuts :)
@TVolden commented on GitHub (Oct 27, 2022):
I have a similar problem on Windows 10 and Windows Terminal Version: 1.15.2874.0
When I open a new terminal window, the caret does not blink and it does not respond to keyboard input.
It's not possible to open new tabs via hotkeys or to use the windows button to minimize/maximize the terminal window.
CTRL+TAB to focus on the window does not help.
The problem can be fixed by mouse-clicking on the terminal window or by pressing the ALT+F4 hotkey. (The caret starts blinking and hotkeys work).
@mgrossmann commented on GitHub (Nov 8, 2022):
Same problem with v1.15.2524.0
@zadjii-msft commented on GitHub (Nov 8, 2022):
Lawds I can't repro this. We've got piles of reports, so this is definitely a real bug, but I can't get it to happen with any regularity.
Maybe it has something to do with DPI scaling?
Maybe there's something I can script up to insert in the powershell startup, to debug this? Theoretically, I can't have y'all click on the window to run commands, cause that would manually focus it (destroying the bad state we're curious about). But maybe there's something we can gather at the time the tab is created, automatically?
@zadjii-msft commented on GitHub (Nov 8, 2022):
Wait is WSL installed and running when this repros? Maybe this is the WSLg thing, in secret? Does this happen every time the terminal launches? Maybe it's not the conpty window that's stealing foreground. How to check...
@matthuisman commented on GitHub (Nov 8, 2022):
happens everytime when I launch terminal.

I do have WSL installed
Opening any other shell also does not get focus until clicked
@spootle commented on GitHub (Nov 8, 2022):
If I open a powershell tab, run wsl --shutdown and open another powershell tab it still fails to get focus in the same way, if that helps.
@zadjii-msft commented on GitHub (Nov 9, 2022):
Alright, a friend on the input team has an idea. For the folks that are hitting this consistently, we've got an idea how to debug. For this, you'll need
InputCore.wprpfrom: https://gist.github.com/zadjii-msft/b67cc8946202593725f7ada64c6cb0c1conhost.exefrom the run dialog should work). (This might need to be run as admin, I forget)input_trace.etlfile here.This is basically a specific Feedback Hub trace, but without all the extra steps. I'll pass those along to @ekoschik, and hopefully we can get to the bottom of what's going on here.
@spootle commented on GitHub (Nov 9, 2022):
input_trace.zip
@lbise commented on GitHub (Nov 11, 2022):
input_trace.zip
There you go, when opening a WSL window.
@zadjii-msft commented on GitHub (Nov 11, 2022):
Hokay, now I'm maybe asking too much here. Would anyone who's reproing this consistently be willing to check out the Terminal code, build
main(just to validate that the issue is still happening on a dev build), then check outdev/migrie/b/13388-experiments-0, and see if the issue persists? Apparently, there's definitely aWM_ACTIVATEin the trace, on the hidden window (which should absolutely never really get brought to the FG).The theory is that
MA_NOACTIVATEANDEATshould prevent that? Again, I can't seem to repro the issue myself, which is why I'm asking for a little help here ☺️@spootle commented on GitHub (Nov 12, 2022):
Unfortunately I can't seem to get it to even build on my machine currently so it's going to be up to @lbise from the look of it
@lbise commented on GitHub (Nov 12, 2022):
Looks like I can only reproduce at work and I will be off next week so it will have to wait a bit.
@trueuto commented on GitHub (Nov 18, 2022):
Hi @zadjii-msft,
your own remark from previous comments:
"NOTE TO SELF: Assigning to myself to investigate on the Win10 VM to see if I can't repro this."
Have you tried that already? ;)
T
@zadjii-msft commented on GitHub (Nov 18, 2022):
You know, I actually have. This didn't repro on my 19041 laptop, my Win10 VM, my 22000 VM, nor my 25249 PC. Hence why I'm looking for some help.
@trueuto commented on GitHub (Nov 18, 2022):
That's what I thought, but it was worth trying anyway...
I am hitting this all the time now, but I am not able to build it on this PC. I will check on another one if I face the same and try it there.
@zadjii-msft commented on GitHub (Nov 18, 2022):
Alright I'm trying something new:
Dev Build
That should have a CascadiaPackage .msix that will install a Dev build of the Terminal. You should be able to launch the dev version of the Terminal just like the stable version, but with a green DEV logo.
Can folks try that out? (I haven't tried sharing a build like this yet so we might have some technical difficulties)
@spootle commented on GitHub (Nov 19, 2022):
Got the dev build installed (I quite like the green dev label), unfortunately doesn't resolve the issue. Terminal still doesn't get focus on launch, or when opening a new tab.
e: for those also looking to install it on Win10, I had to extract the .msix to a folder and run Add-AppxPackage -Register against the manifest to get it to install unsigned in case anyone tries and fails to install the .msix directly
e2: another thing I noticed that I can't remember if it was mentioned earlier, is closing a tab correctly gives focus to the next tab, it's only opening a new tab that triggers this
@trueuto commented on GitHub (Nov 20, 2022):
Not sure if this matters, but I thought I may share one more observation: it happens that when I start Terminal (i.e. new and first instance) it is already visible as icon on the taskbar, visible in the Alt-Tab list, but window itself is not visible yet. Initially I thought it was my computer lagging or so, but now I think it could have been that this first "invisible" window is up, and the actual terminal is yet to start (due to a lagging PC possibly).
Another idea to check is to install one of the older Terminal releases on a recent Windows 10/11 VM - this may help to determine if there was some change in the Terminal code itself, or maybe some Windows related patch changed its behaviour. Just a thought...
@lousyd commented on GitHub (Nov 21, 2022):
Do you still need someone to do this, @zadjii-msft?
@zadjii-msft commented on GitHub (Nov 21, 2022):
@lousyd sounds like @spootle tried the release I built manually, and that didn't seem to fix it.
We'll need to come up with some other hypothesis 😕
@Anutrix commented on GitHub (Nov 27, 2022):
I suspect it's some Windows related patch too.
I came to this train of thought because I was facing this almost consistently past few months. This behavior annoyed me to point that I developed a habit of clicking terminal after the first seconds.
Oddly, I haven't faced the issue in past few weeks. I'm on Windows 11(Microsoft Windows 10.0.22621) now. Not sure if was fixed in 22H2.Update : The issue is still there.
@JoeTeumer commented on GitHub (Nov 28, 2022):
Windows Terminal
Version: 1.15.2874.0
Windows 10 Enterprise
21H2
19044.2251
I started having the issue with Opening New Tabs/Windows and I cannot type in them.
I need to use the mouse and click in the pane to focus.
This had worked OK for years.
I did install a round of Windows updates last week and now Windows Terminal focus is broken.
Status=Installed, Title=2022-11 .NET Core 3.1.31 Update for x64 Client (KB5020930)
Status=Installed, Title=2022-11 Cumulative Update for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 10 Version 21H2 for x64 (KB5020687)
Status=Installed, Title=2022-11 .NET 6.0.11 Update for x64 Client (KB5020743)
Status=Installed, Title=2022-11 Cumulative Update for Windows 10 Version 21H2 for x64-based Systems (KB5019959)
@JvdBossche commented on GitHub (Dec 1, 2022):
I'm also having this problem.
Specifically after opening wt (defaults to (old) "Command Prompt") or any new tab (using any shell) I can see that in the first few milliseconds the new window (or tab) has focus and then loses it. This is visible since I have some GUI setting that highlights the focussed window with a colored border.
I could not run wpr as suggested above. It returns
This happens both when conhost is run normally or as administrator. This is a company laptop that is greatly locked down, but I do have admin rights (though I have to fill in a form that pops-up every time I do something like this, before it starts the as-admin-process). For that reason, I'm not even going to try to install the dev version, sorry.
My little machine, PPC15491, is a Windows 10 Enterprise build 10.0.19044
Windows Terminal is the 1.15.2874.0 version
Patches:
@trueuto commented on GitHub (Dec 14, 2022):
I have installed recent updates today, unfortunately no change. I am running Win 10 21H2.
@MrStrik3 commented on GitHub (Dec 14, 2022):
It won't be of any help in fixing this issue but I have been using Windows Terminal for more than a year now, and I always had have this terminal focusing issue. Saying so, I don't thing it's related to the past windows updates. Lots of thank yous to everybody who is trying to fix this issue, it's very appreciated 🥇
@trueuto commented on GitHub (Dec 15, 2022):
I have just received Terminal Preview update to the 1.16.3463.0 version and it seems there is no more focus issue! I will confirm over the next couple of days.
@zadjii-msft commented on GitHub (Dec 15, 2022):
👀
I honestly don't think there's anything in that latest 1.16 patch that should have fixed this...
@JoeTeumer commented on GitHub (Dec 15, 2022):
Thanks for the tip on the Preview build.
After installing it unexpectedly fixed my Stable build 1.15.3456.0.
I can split terminal panes and open new tabs and focus is correctly following the new pane. Will keep testing...
@zadjii-msft commented on GitHub (Dec 15, 2022):
if #14196 fixed this I'll literally venmo Dustin a beer, cause we've had NO leads for the longest time.
Though, I'd reckon it'd be something that merged after https://github.com/microsoft/terminal/issues/13388#issuecomment-1322337109
@nephewtom commented on GitHub (Dec 15, 2022):
I am also having this issue.
Exactly as it is described here: https://github.com/microsoft/terminal/issues/13846
Currently:
This has been happening since the first day Windows Terminal was installed on a September.
And though several Windows 10 patches have been installed, the issue persists.
@zadjii-msft commented on GitHub (Dec 15, 2022):
@tomasorti You wanna try out https://github.com/microsoft/terminal/releases/tag/v1.15.3465.0? I have literally no reason to suspect that fixes it, but other people have had success?
@nephewtom commented on GitHub (Dec 15, 2022):
It seems to work with that version, thank you.
Hope it does not break other stuff...
@JoeTeumer commented on GitHub (Dec 15, 2022):
Unfortunately, this update causes other issues.
Steps:
open an app such as Microsoft Edge or OneNote
open Windows Terminal 1.15.3456.0
select OneNote, start entering text
randomly, the Windows Terminal opens up and the text input is now directed to terminal instead of OneNote
@trueuto commented on GitHub (Dec 16, 2022):
I have the same issue as @JoeTeumer.
My observations are:
It seems that we're still facing the same issue but it is only delayed now...
@hassec commented on GitHub (Dec 16, 2022):
Just upgraded my terminal too, and I can repro what @trueuto explained.
@neilrees commented on GitHub (Dec 19, 2022):
After installing the dev build above...
On launch the new window does not receive focus, but after clicking once to bring it to the foreground newly created tabs do focus correctly. It doesn't persist though, sometimes switching away and then ALT+TAB to return doesn't return focus to it, but once clicking it works correctly again.
Interestingly I observe the same behaviour in the main Windows Terminal whilst the Dev Windows Terminal is running - new tabs open correctly and it generally works much better. When Dev Windows Terminal is closed the old behaviour returns.
Hope that's useful to your fault finding.
@trueuto commented on GitHub (Dec 19, 2022):
Hi, I have the following update to my observations above:
I have used this quick and dirty script below to get that info - I am not sure if this is a valid troubleshooting, though. I have started it in the Windows PowerShell session running in one of the Windows Terminal tabs. Changing the profile started by the
wt new-profile -p "profile"command makes this new invisible window to belong to the respective shell process.I hope this helps.
@trueuto commented on GitHub (Dec 20, 2022):
Yet another update:
@rwasef1830 commented on GitHub (Dec 25, 2022):
I'm experiencing a similar issue as this but on Microsoft Edge, in addition to Windows Terminal. Quickly alt-tab from an app to edge, the edge title lights up but then no keyboard button works i have to click inside to use it. I think this is not just a Windows Terminal issue. Windows 11 22H2 being used over RDP on a Dell Precision 7510 running Windows 10 22H2.My issue got solved by disabling all extensions and enabling them one by one. I don't understand why that worked.
@trueuto commented on GitHub (Jan 4, 2023):
Hi @zadjii-msft
do you have any new idea of how to approach this issue? Any hope to have it resolved? 🥺
Regards,
T
@zadjii-msft commented on GitHub (Jan 4, 2023):
Nope, not yet. Just getting back from the holidays for the last couple weeks. I'll probably needs some help from my resident User32 expert colleague, who I think is still out this week. The
MA_NOACTIVATEANDEATthing didn't work, so it's back to the drawing board.@zadjii-msft commented on GitHub (Jan 11, 2023):
New year, new shot in the dark to fix it. Could I have some folks who are still hitting this bug try the following build?
>> Get the .msix here <<
That should have a CascadiaPackage .msix that will install a Dev build of the Terminal. You should be able to launch the dev version of the Terminal just like the stable version, but with a green DEV logo.
Can folks try that out?
@spootle commented on GitHub (Jan 11, 2023):
maintainer note: editorialized to focus on topic at hand. the white text issue was moved to #14667
This build appears to have resolved it for me in initial testing ... (but it at least appears to resolve this actual issue from what I can see so far)
Original post
This build appears to have resolved it for me in initial testing, with a completely unrelated side effect of the dark mode for settings having the light mode color background rendering it completely unreadable (but it at least appears to resolve this actual issue from what I can see so far)
@zadjii-msft commented on GitHub (Jan 11, 2023):
Hmm. That's probably a regression from #14567 oh god yea I definitely broke that. But that's totally unrelated (thankfully)!
That's great to hear. I'll give folks a bit longer to see if there's any other feedback. If I get any more confirmation that it seems to work, I'll probably just file a PR to put that in 1.17 for later this month.
@winni2k commented on GitHub (Jan 12, 2023):
I have the originally reported issue too.
@trueuto commented on GitHub (Jan 12, 2023):
@winni2k you mean the same as @spootle reported? What about the original (focus) issue - did it get fixed for you?
@zadjii-msft commented on GitHub (Jan 12, 2023):
Yea, I'm gonna treat that as a +1 unless otherwise corrected. I'm also gonna go back and tidy up @spootle's earlier comment just so that we can hopefully drill in on the resolution here. Thanks all ☺️
@winni2k commented on GitHub (Jan 12, 2023):
I tried to install the .msix file, but it is unsigned. I'll have to wait for others to do the testing, sorry.
@zadjii-msft commented on GitHub (Jan 12, 2023):
Oh derp that makes sense, I think I used the PR build pipeline instead of the Release build 😅
I can kick one of those off.Er, maybe I can't. Well, that's okay. We had a couple volunteers for the last unsigned one, so I'm gonna go with that for now.@ilyaradko commented on GitHub (Jan 13, 2023):
@zadjii-msft I am afraid a severe security threat has been introduced with this new update. Indeed, the focus is not lost anymore. However, the terminal now actively steals the focus from other applications ~30 seconds after the start if it is not active. To reproduce it: start a terminal, then switch to another app, and approximately 30 seconds after the terminal was launched it will pop up and get the focus.
Imagine a scenario where you type something in a notepad (pressing Enter occasionally) and not looking at the monitor. What can happen is that you might execute a command without being aware of that, which is very dangerous. I would rather prefer to lose the focus from terminal than terminal actively stealing the focus from other apps.
@zadjii-msft commented on GitHub (Jan 13, 2023):
Hmm. That does seem to corroborate earlier reports that the Terminal loses focus about 30s after launching the tab. The change in that build is intended to yeet focus from the hidden window backing each tab, to the main Terminal HWND whenever the hidden window gets activated. The fact that it's getting activated at all, let alone 30s after launching the tab, that's what we don't understand. It's an invisible window. It's got
WS_EX_NOACTIVATE. It should never be activated in the first place.Back to the drawing board.
@spootle commented on GitHub (Jan 13, 2023):
Interestingly I can't replicate this stolen focus report, I've been using that latest dev build since installing it and it hasn't stolen focus once, it's behaved exactly as I would expect any other window to. In fact I'm even typing this slowly after freshly starting the terminal just to see if it steals any of this text, and it hasn't taken any of it.
For @winni2k, you can install the unsigned package by extracting the .msix to a folder and using
Add-AppxPackage -Register .\AppxManifest.xmlin powershell@zadjii-msft commented on GitHub (Jan 13, 2023):
It's just the darndest thing. We're a tad worried that there's something installed / running that's affecting the timing here. Something like some accessibility tool, or antivirus, or autohotkey, I dunno those are just usual suspects.
My next theory is to yeet activation back at whoever just lost activation. Theoretically, that would toss it back to whoever is actually in the FG. Theoretically.
@DHowett commented on GitHub (Jan 13, 2023):
This is a dangerous game to play, and I don't recommend we do that! Can the pseudoconsole window simply reject activation and let the system do what it would otherwise? Can the window be made nonactivatable?
@zadjii-msft commented on GitHub (Jan 13, 2023):
By all accounts, setting our window as
WS_EX_NOACTIVATEshould have done that. I'm pretty sure there's no way to say "no thanks, I don't want to be activated" once we get that message.@rwasef1830 commented on GitHub (Jan 13, 2023):
Could this be related to Docker For Windows Desktop ? I see in procmon it spams launching a wsl shell every few seconds for stupid reasons which causes all kinds of trouble (Makes the task bar go up and down by itself, auto hide mode), and prevents my monitors from sleeping.
@zadjii-msft commented on GitHub (Jan 13, 2023):
YES IT COULD BE
@spootle commented on GitHub (Jan 13, 2023):
I am deliberately running a much older version of Docker Desktop (4.2.0) due to other issues I have had in the past with upgrading it, if that helps narrow down why mine isn't stealing focus...
@zadjii-msft commented on GitHub (Jan 13, 2023):
Alternatively, it could be because some CLI process it calling
ActivateWindow(GetConsoleWindow()), though, that would probably be more obviously related to whatever's running in the console when the bug occurs.I honestly have no idea if the Docker thing is necessarily related. I know there's been a lot of issues in the past with WSLg starting up and stealing focus. Docker does have some WSL distros that they use behind the scenes, so maybe that's complicating things.
That however wouldn't explain why our "manually focus the Terminal when our hidden hwnd gets WM_ACTIVATE'd" seems to steal focus after some time.
@zadjii-msft commented on GitHub (Jan 13, 2023):
Interesting late friday notes:
pwsh -command { import-native; steal-fg; }will then steal the focus. Presumably, in the same way. I don't think there's anything we can do about that, yikes.@zadjii-msft commented on GitHub (Jan 13, 2023):
Another thought - we might be able to rule out or finger WSLg this by temporarily disabling WSLg: Configuration setting for .wslconfig. Though, the notes there state that setting only works on Windows 11, and it seems like most folks are encountering this on Windows 10. I dunno for sure if that * is a lie or not.
I might start next week looking through here: https://github.com/docker/for-win/issues?q=is%3Aissue+console+window. That sure does feel like a dead end though.
That's all I've got for this weekend.
@mati865 commented on GitHub (Jan 13, 2023):
I had this issue on Windows 10 provided by my employer with old builtin WSL (no WSLg). I have been able to install WSL from the store just recently so I don't think WSLg is related at all.
@Anutrix commented on GitHub (Jan 14, 2023):
The issue only happens once on first usage after reboot for me. Once I face the loss of focus issue, it doesn't lose focus on any new terminal window till next reboot of my PC.
I noted this multiple times so I'm about 80% sure.
@trueuto commented on GitHub (Jan 14, 2023):
I confirm this has been happening to me before I have installed WSL from the store. Also, it does not affect only WSL sessions; PowerShell or cmd are also affected. I do have autohotkey installed (as someone suggested earlier) - I will stop all running AHK scripts and check that again (although I think I have already checked that in the past...) The idea of some specific AV software may also be correct I'm afraid...
Anyway, it's good to see some traction here after a while!
@trueuto commented on GitHub (Jan 14, 2023):
With no AHK scripts running (and also with PowerToys stopped - it's Run component has a plugin for WT) - no luck.
@trueuto commented on GitHub (Jan 17, 2023):
WSLg works for recent updates of Windows 10 as well. I have just disabled it but it did not help. Anyway, I regularly run WSLv1 distro only and v2 is rarely in use, but the focus issue is constantly present.
Why is it considered it has anything to do with WSL? I face this problem even if the only opened tabs in WT are PowerShell and newly started are e.g. CMD or PowerShell (with wsl completely stopped via
wsl --shutdown)@zadjii-msft commented on GitHub (Jan 17, 2023):
Eh, the Docker comment before had me drilled in on something that wasn't relevant. Docker leverages WSL distros in unusual ways to back some of its containers. I thought there was a chance there was a bug in the interaction between those distros and the WSLg bug that steals focus on boot.
Anywho, since folks are seeing this entirely without WSL, then that's a dead end.
Instead, we might want to drill in on whatever's trying to
SetForegroundWindowthe console window. That's obviously not gonna work. Though, it's like... if that's what some script was trying to do, then in conhost, you'd see the Console window pop up unexpectedly. I still wanna say this is something weird that the OS is doing with the pseudo window on launch. Maybe I just need to add gratuitous tracing to try and get a collection of window messages (and timing) for my User32 friends to take a look at.ConsoleInputThreadProcWin32callsVtIo::CreatePseudoWindowwhich callsPtySignalInputThread::CreatePseudoWindowto create the window, with the owner.ConptyConnection::Start, We callConptyReparentPseudoConsoleIMMEDIATELY AFTER_CreatePseudoConsoleAndPipes(which does theConptyCreatePseudoConsole)ConsoleInputThreadProcWin32before Terminal gets toConptyReparentPseudoConsole. Theoretically.That's at least an idea to start with. Pass the owner hwnd on the commandline. Dumb, but doable. At least to rule that out.
@trueuto commented on GitHub (Jan 17, 2023):
Since some people here reported the problem on company's PCs - can it be that it is some antivirus or other anti-malware software trying to scan/analyse the console process with hidden window for potential threats? Is there any way to track it further down?
@zadjii-msft commented on GitHub (Jan 17, 2023):
wake up babe, new random shot in the dark to try out just dropped. Could I have some folks who are still hitting this bug try the following build?
>> Get the .msix here <<
That should have a CascadiaPackage .msix that will install a Dev build of the Terminal. You should be able to launch the dev version of the Terminal just like the stable version, but with a green DEV logo. It might be unsigned - sorry about that! I don't think I know how to release-sign a dev build like this. You may need to enable Developer Mode to let the OS install unsigned packages.
Can folks try that out?
(this is commit
68d854011, which is "try to set the owner HWND immediately as the conpty is created")@spootle commented on GitHub (Jan 17, 2023):
@zadjii-msft unfortunately for me this build has reverted the focus behaviour back to the original issue, opening a new window or tab doesn't set focus to the terminal at all
@zadjii-msft commented on GitHub (Jan 17, 2023):
Welp, then we'll have to try Plan D. The D stands for "I Dunno what we're going to try next".
(thanks everyone for bearing with my ever increasing frustration with this one. I'm attempting to use humor as a defense mechanism)
@trueuto commented on GitHub (Jan 18, 2023):
That at least was much less annoying as compared to the currently observed behaviour.
I know it may sound crazy, but is it worth trying - with this immediate focus loss - to forcefully set focus back to the terminal after a fraction of the second? Not a solution definitely, but maybe some workaround that may make it more usable and give more time to actually fix it.
The other option that comes on my mind is to try installing WT version older than 1.14.1451.0 (which is mentioned in this bug report in the initial post) and see if that behaves normally? This way we could rule out other things, theoretically...
I wish I could try that myself but with limited privileges I have on my PC I can only install what gets officially released via Store.
@zadjii-msft commented on GitHub (Jan 18, 2023):
You'll note that's basically what I tried in https://github.com/microsoft/terminal/issues/13388#issuecomment-1379117011 (which was
7da382c948). Basically, whenever the pseudo window got activated, I'd re-activate the Terminal window.The curious thing here is this mysterious 20-30s delay. That pseudo window should be created basically as soon as the tab starts. There shouldn't be any reason for that window to be activated by the system, unless it's being activated by some commandline script / exe.
Now, if the focus gets stolen after some delay, while the tab is just sitting idle (just sitting at a powershell / cmd prompt), then that makes me thing one of these things is happening:
closeOnExit: neverin the settings, but I'm doubting thisIt's seemingly none of those, so what is it
I think I'm gonna try a variation on
attempt-001, but making sure the active window (which is losing activation) is in fact, the Terminal's window. That should mitigate https://github.com/microsoft/terminal/issues/13388#issuecomment-1382027489, where some other app is active when the pseudo hwnd gets activated, and we end up taking foreground from it.@trueuto commented on GitHub (Jan 18, 2023):
Thanks for explaining it!
Maybe it is just me misinterpreting what you wrote, but this happens not only if the tab is idle - if I am typing into the tab, the focus would be lost as well.
There is one more thing I have noticed and that is quite consistent (regardless of both tabs use the same shell or not):
But when you close tab A instead of B in step 3 above, it would. So it seems this hidden window gets only activated for the most recently started tab/shell.
@Anutrix commented on GitHub (Jan 18, 2023):
Found the culprit I think:
Tool used is https://github.com/JocysCom/FocusLogger.
Always reproducible after a fresh Windows reboot.
Apparently, there's already a ticket for it https://github.com/microsoft/wslg/issues/894.
UPDATE:
Got it to reproduce 100%.
After fresh windows boot,
Now msrdc.exe will stay open for few seconds.
If you open WSL in new terminal before msrdc.exe closes, your terminal won't lose focus.
If you open WSL in new terminal after msrdc.exe closes, your terminal will lose focus in few seconds when msrdc.exe starts again.
@trueuto commented on GitHub (Jan 18, 2023):
@Anutrix I think we have already ruled out WSLg. Also, this problem occurs even if there is no WSL running at all. And the application that "gets" the focus when it is stolen from Windows Terminal is the shell process of the most recently started Windows Terminal tab and not msrdc.exe
@Anutrix commented on GitHub (Jan 18, 2023):
I have never lost focus when WSL wasn't running. So it might be a different rarer bug but I think it's a false positive.
And I have 100% of the times lost focus when WSL was started while msrdc.exe is not running background.
UPDATE:
Followed same steps and lost focus in Cmder.exe too so it's not WT specific.
@rwasef1830 commented on GitHub (Jan 18, 2023):
Could it be Discord ? I see it flashes the taskbar icon a lot and is focus-steal happy especially when trying to notify for new messages.
@Vaskinn commented on GitHub (Jan 18, 2023):
Unlikely. I have this problem on a machine without discord, and not on a machine with discord. (unless the guilty part is a component or something that discord is sharing with something I have installed)
@migue-pki commented on GitHub (Jan 18, 2023):
I just tried the focus monitoring tool shared by @Anutrix and these are my results:
Initially
pwshis getting the focus instead ofWindowsTerminal, so it's not accepting any of my keypresses. After about 8 seconds pwsh grabs the focus, I press Alt-F4 (or click inside the window, the result is the same) and then WindowsTerminal is finally able to get the focus and I can start typing normally.@zadjii-msft commented on GitHub (Jan 18, 2023):
Ah shoot. Okay, so now we've got some folks with this issue due to WSLg, and some without it. Shoot. That's gonna make reparsing this whole thread.... challenging. I might need to create a separate table with all the folks experiencing this, that have confirmed they don't have WSL installed. Like, at this point, I might need to be as nuclear as that to rule it out.
The MSCTFIME UI invokes are also... interesting to me. The IME totally could be something that does w e i r d things. Like, it's not here in that trace above, but.... maybe that's the thing trying to smuggle focus from the Terminal to the phwnd.
I'm gonna editorialize and compile reports from folks that have provided more specific details below. There's gotta be something I'm missing.
MA_NOACTIVATEANDEATIf I open a powershell tab, run wsl --shutdown and open another powershell tab it still fails to get focus in the same way
{Attmept 1} appears to have resolved it for me in initial testing ... (but it at least appears to resolve this actual issue from what I can see so far)
I am deliberately running a much older version of Docker Desktop (4.2.0) due to other issues I have had in the past with upgrading it, if that helps narrow down why mine isn't stealing focus...
Interestingly I can't replicate this stolen focus report,
unfortunately for me {Attempt 2} has reverted the focus behaviour back to the original issue, opening a new window or tab doesn't set focus to the terminal at all
(re: Terminal 1.15.3456) I have the same issue as @JoeTeumer.
It seems that we're still facing the same issue but it is only delayed now...
I confirm this has been happening to me before I have installed WSL from the store. Also, it does not affect only WSL sessions; PowerShell or cmd are also affected.
With no AHK scripts running (and also with PowerToys stopped - it's Run component has a plugin for WT) - no luck.
1: Initially
pwshis getting the focus instead ofWindowsTerminal, so it's not accepting any of my keypresses. After about 8 seconds pwsh grabs the focus, I press Alt-F4 (or click inside the window, the result is the same) and then WindowsTerminal is finally able to get the focus and I can start typing normally.‼️‼️ WAS RUNNING "Privilege Guard Client" by Avecto ‼️‼️ - A whole bunch of people were all running this too, this might be our culprit.
Found the culprit I think:
C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.3.0_x64__8wekyb3d8bbwe\msrdc.exeSo, this person's issue was definitely the WSL one
I had this issue on Windows 10 provided by my employer with old builtin WSL (no WSLg). I have been able to install WSL from the store just recently so I don't think WSLg is related at all.
re: {Attmept 1}
Indeed, the focus is not lost anymore. However, the terminal now actively steals the focus from other applications ~30 seconds after the start if it is not active. To reproduce it: start a terminal, then switch to another app, and approximately 30 seconds after the terminal was launched it will pop up and get the focus.
@migue-pki commented on GitHub (Jan 18, 2023):
To add a bit more info to my previous comment:
@zadjii-msft commented on GitHub (Jan 18, 2023):
@migue-pki Just for my own notes, which one & version? Literally anything could be a lead at this point. This thread might be tracking 4 different root causes for all I know.
@migue-pki commented on GitHub (Jan 18, 2023):
The IME is just the one that comes with Windows 10, no additional third-party packages as far as I know:
@zadjii-msft commented on GitHub (Jan 20, 2023):
I'm gonna stash some quick notes before I hit the road for the weekend:
GetConsoleWindow()that will break in the Terminal again. But I'm under the impression that the pain of this bug is a lot worse than the small population of apps that were using that API in the first place.Sorry, I wish it was better news.
@ChristophSonnleitner commented on GitHub (Jan 21, 2023):
I doubt this will help anyone, but in my case I was running a python-script I had scheduled to run before the terminal-launch with another script that launches it without showing a console window pop up.
That's what was stealing my focus (inconsistently), and as far as I can tell only on first launch of WT via shortcut [second window opened via shortcut is focused].
removing NoScript.vbs fixed the issue for me.
NoScript.vbs:
P.S: The python script renames the image files in my folder from i.png to i+1.png (with a modulo by n), where i = [0..n]) and I choose 0.png as my background image in the wt settings so I have e new background every time I launch. Would be a cool feature if we could just select a folder for background image and WT selects the image randomly from there.
P.P.S. after revisiting this subject I realized that I can just run pythonw instead of python to achieve the same result [no window popup] facepalm
@spootle commented on GitHub (Jan 26, 2023):
I still have zero focus stealing issues with attempt-1 (using as daily driver since), so I agree that others most likely have something installed that's doing this that I don't. Unfortunately my corporate group policy apparently blocks me from submitting feedback through feedback hub, is there any other way to manually get the list that would have generated?
@trueuto commented on GitHub (Jan 27, 2023):
I think it may be that all these attempt-n were never tested enough by this community here. And e.g. in my case it was because I am unable to install it if it does not come from the store (or is not signed, whatever).
@zadjii-msft - with the attempt-1 resulting in some positive feedback, would it be possible to include it in the next Terminal Preview release so that it can be easier deployed and tested?
@PennRobotics commented on GitHub (Feb 13, 2023):
I'm also seeing this (focus stolen after 5 or 10 seconds, only on the first WSL start from shutdown state) on a work computer (group policy, etc):
caused (like the others mentioned) by msrdc.exe.
Process Monitor shows a ton of activity: registry access, loading DLLs, opening files, starting new threads. The main thread created has Command line
msrdc.exe /v:9740E94F-E8E4-425C-B405-17FC49E1DC02 /hvsocketserviceid:4275F880-FACB-11E6-BD58-64006A7986D3 /silent /wslg /plugin:WSLDVC_PACKAGE /wslgsharedmemorypath:WSL\9740E94F-E8E4-425C-B405-17FC49E1DC02\wslg "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.3.0_x64__8wekyb3d8bbwe\wslg.rdp"(although if I add the .wslconfig line for disabling wslg, I still have focus stolen).Only other notable details I can imagine: using AHK, proxy, a handful of network mounts, some Novell management software, running rkhunter in the background as part of my startup .rc (although that has been in-place for over a year while the focus stealing started a few weeks or months ago), and I just recently switched to the Store-based WSL. This does not happen with Powershell/cmd.exe---only with WSL (however, the focus stealing also happens in the classic conhost terminal)
I'm not sure what other detail to provide because the procmon capture of msrdc is pretty overwhelming (51,000+ events). Also, it seems this is WSL-related on my machine, so it probably belongs on microsoft/wsl rather than here, but as others mention Powershell is also affected, I can only share my own experience without a strong recommendation.
Edit: adding
guiApplications=falsein .wslconfig stopped the focus stealing. I thought it belonged in WSL's $HOME, but after reading other threads and putting this file in my Windows user directory, I can now open WSL and type without interruption.I'm not sure what the fix would then be for Powershell as it never affected me... Sorry if this is somehow unrelated to the original issue!
@zadjii-msft commented on GitHub (Feb 14, 2023):
/idle thought: could it be some flavor of git? When I
git commit, then save the file and exit it, focus doesn't return to the Terminal. Maybe it never did. Maybe they're manually activating the console HWND - they've done silly things with the HWND in the past...@trueuto commented on GitHub (Feb 15, 2023):
I don't think it has anything to do with Git. I have seen it recently on a PC with no Git installed. I am tempted to say it may be caused by some AV or other security application.
@zoulja commented on GitHub (Feb 15, 2023):
Got the same issue (after opening session focus is on the Tab itself, not on the command line input, so have to click. Pressing Left/Right switches tabs)
But got it only in the recent Preview build and only with sessions in folders/groups.
The same session in the main list (outside of a folder) works well.
All my sessions are SSH ones:
"commandline": "ssh somehost"Any workaround, please?
@y1rn commented on GitHub (Apr 14, 2023):
same issue on windows 10 for long time.
@zadjii-msft commented on GitHub (Apr 14, 2023):
Wait so I had a totally random other thought about this.
Again, let's not involve WSL at all in this, because of the aforementioned issues with WSLg stealing focus as it boots up. So only test with Command Prompt or PowerShell tabs (and make sure WSL isn't in your
profile.ps1)Does this repro
There's been bugs in the past about focus secretly moving somewhere else in the Terminal app itself. Most recently, #15049. That one's specific to nested dropdown entries (which are new in 1.17), but a helpful reminder that we've had these issues before. ESPECIALLY when opening tabs via the new tab dropdown.
I still haven't had any luck repro'ing this. Maybe for the folks who are seeing this, especially after some delay, can you try https://github.com/JocysCom/FocusLogger? That 3p tool looks like it's exactly what we need to root cause who's stealing the focus here.
Adding a flag to disable #2988 is... complicated, especially considering the way it's all plumbed together. Not impossible, but it'd be very much a "set the house on fire to kill a spider" kinda solution.
edit: Alternatively, if folks want a Small Program for testing this, you could try compiling
8db8bd3ec3/src/tools/scratch/main.cpp. That's a fairly simple program for just logging whatever's in the foreground. Just pop that into a SEPERATE console window, and go about your business until the bug repros.Edit 2: OR as a powershell script: https://github.com/microsoft/terminal/blob/211f3160a/src/tools/scratch/focus-logger.ps1
@trueuto commented on GitHub (Apr 17, 2023):
Hi @zadjii-msft,
I have used the powershell script referenced above (https://github.com/microsoft/terminal/blob/211f3160a/src/tools/scratch/focus-logger.ps1) for testing.
TL;DR:
I have executed 3 tests, in each case the issue has occurred the same way and in each case the process stealing focus was the shell process of the WT window/tab. This exactly matches to my previous comments on that using other script (https://github.com/microsoft/terminal/issues/13388#issuecomment-1357415961) to track focus.
Detailed info
Scenario 1:
Steps:
Result:
Scenario 2:
Steps:
Results:
Scenario 3:
Steps:
Results:
@tomvoss commented on GitHub (May 4, 2023):
I recently installed Windows Terminal Preview version 1.17.1023 from the Microsoft Store. I proceeded to add some new profiles. I created some where the command line is
"%WINDIR%\\System32\\OpenSSH\\ssh.exe user@host". These new profiles launched in new tabs and immediately received focus.Here's the interesting part: I copied the GUID of one of these profiles to the new
newTabMenusection of the settings.json file and put it inside of a folder. When I launched the profile from within the folder the new tab did not receive focus. I reproduced this multiple times. As another test I pressed the tab key after launching the profile from within the folder and the plus sign and down arrow immediately to the right of this new tab became highlighted with a black border around them. This would seem to indicate that after launching a profile from within a folder, the tab title itself is where the focus is rather than within the tab's window/body.I hope this information can be helpful to someone. I apologize that I did not have time to read through this entire issue to see if this has already been brought up by someone else or if there is another issue with similar information.
@cfbao commented on GitHub (May 25, 2023):
On my company laptop, I'm experiencing almost the exact issue @trueuto described here: https://github.com/microsoft/terminal/issues/13388#issuecomment-1354331077
i.e. New tab then focus switched to the shell process after ~30 seconds. No WSL running (though installed).
Some more details and possible culprit in my specific case:
C:\Program Files\Avecto\Privilege Guard Client\PGHook.dlland has stack like this"Privilege Guard Client" is part of the BeyondTrust privilege management solution that our IT has deployed recently. It seems a very likely culprit at least in my case. Will talk to our IT for more details.
@zadjii-msft commented on GitHub (May 25, 2023):
WELL THAT LOOKS LIKE A CULPRIT.
I will be so unbelievably annoyed but also relieved if there really was a piece of 3p software that was hijacking this after all
@LarsKaulen commented on GitHub (May 25, 2023):
I have the same issue and also have "Privilege Guard Client" by Avecto installed on my company laptop.
@PennRobotics commented on GitHub (May 25, 2023):
There's a registry value called "HookExclusions" under an "Avecto" key. I can't check personally; I reinstalled Windows on my work computer and the issue is now gone for me… no idea if I had Avecto on the old installation, but it's not on my PC currently.
Edit: https://support.citrix.com/article/CTX140974/virtual-delivery-agent-installation-with-avecto-privilege-guard
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Avecto\Privilege Guard Client@winni2k commented on GitHub (May 25, 2023):
I also run beyond trust on my machine and have this issue.
On May 25, 2023, "Maxime U. Garcia" @.***> wrote:
—
Reply to this email directly, view it on GitHub
<https://github.com/microsoft/terminal/issues/13388#issuecomment-
1562983485>, or unsubscribe
<https://github.com/notifications/unsubscribe-
auth/AACKOPQ3IZZ5UIQQN4VJST3XH5SEDANCNFSM5Z6SZ2FQ>.
You are receiving this because you were mentioned.Message ID:
@.***>
--
Sent with HEY https://hey.com/sent
@DennisGaida commented on GitHub (May 25, 2023):
Fixed in 1.18 for me - no third party Software was interfering, but I am using the new folders (whatever they are called) to start shells.
@migue-pki commented on GitHub (May 25, 2023):
I am still experiencing the issue, and I also have the luck of enjoying "Privilege Guard Client" by Avecto in my company laptop thanks to our IT.
HookExclusionsdoes not seem to be honored, andManagedHookExclusionsis read-only of course.@migue-pki commented on GitHub (May 25, 2023):
Funnily enough, if I copy
WindowsTerminal.exewith a name in the whitelisted programs list stored inManagedHookExclusionsthe focus issue no longer happens to that terminal 🤦@y1rn commented on GitHub (May 26, 2023):
Same situation, I can not edit
ManagedHookExclusionsmyself, Is there other solution?@ilyaradko commented on GitHub (May 26, 2023):
Unfortunately, I cannot confirm the observations. In my case, there is no any antivirus, nor any obvious nasty corporate software (like the abovementioned Avecto) running. In the Process Monitor, I see consistent two ThreadExit events from StartMenuExperienceHost.exe and five ThreadExit from Explorer.exe just before the focus gets stolen. So I believe, there is still something inherent to Windows that causes the issue rather than the 3p software, at least in my case.
@trueuto commented on GitHub (May 26, 2023):
@ilyaradko - what is the Windows version you run? Is it Win10 22H2 already?
It may be good to find out if Win version may be the common denominator here too.
@ilyaradko commented on GitHub (May 26, 2023):
@trueuto, yes, Win10 22H2, Terminal version 1.16.10261.0.
@lbise commented on GitHub (May 26, 2023):
I can confirm that my company also use BeyondTrust Privilege Management tool.
@neilrees commented on GitHub (Jun 16, 2023):
Another report of repro'ing the issue and we also have Avecto BeyondTrust Privilege Management deployed.
@joelnb commented on GitHub (Jun 16, 2023):
I also have BeyondTrust Privilege Management on the work laptop where I experience this. Plus I work at the same company as @praimmugen so it's very likely they had the same software installed at the time of opening the original issue.
@zoulja commented on GitHub (Jun 16, 2023):
I don't have BeyondTrust Privilege Management installed, but still affected by focus issue
@saenzfco commented on GitHub (Jun 20, 2023):
@zoulja do you have another type of privilege management software on your computer? I don't have BeyondTrust, but I have CyberArk and I get the same behavior when creating new tabs.
@trueuto commented on GitHub (Jun 20, 2023):
With all signs of the issue being caused by BeyondTrust (but possibly by some other software too), @zadjii-msft - is there anything you could make to do things you do differently? I know it is not your "fault", but I hardly can imagine these companies making any exceptions or amendments to their software just to make WT users happy...
@zoulja commented on GitHub (Jun 20, 2023):
Nope, this is my home laptop, without any corporate software, just default Win11 setup @saenzfco
@smanning commented on GitHub (Jun 20, 2023):
I have the issue on my corporate laptop that uses BeyondTrust.
@MetaFight commented on GitHub (Jun 28, 2023):
It happens for me on my personal windows 10 laptop with no corporate sniffing/security software running.
It doesn't seem to happen with cmd.exe tabs, but it does happen with Ubuntu tabs AFTER I've issued
wsl --shutdownelsewhere... So maybe it's a timing issue related to the slower startup when wsl needs to start up?I can repro this consistently by running
wsl --shutdownand then opening a new Ubuntu tab. The tab will open and then Terminal visibly loses focus when the bash prompt appears.I'm running version 1.17.11461.0 in quake mode, if that helps.
@ryanmda commented on GitHub (Aug 2, 2023):
Re-posting from my duplicate issue #15786
Okay, I did some version testing.
Version 1.13 works perfectly. Never loses focus to a hidden window
Version 1.14 loses focus once immediately on startup, but not with new tabs. This is the behaviour described at the start of #13388
Versions 1.15 through 1.18 preview all manifest the behaviour on #15786; every new tab loses focus to a hidden window after about 30 seconds
@ilyaradko commented on GitHub (Aug 2, 2023):
I rolled back to version v1.13.1143 and can confirm that the issue is absent. Will stick to this version then. Thanks a lot, @ryanmda, for posting your test results!
@Anutrix commented on GitHub (Aug 2, 2023):
After v1.13.11431.0 - Stable v1.13 comes:
v1.14.1432.0
v1.14.1451.0 - This ticket's OP.
v1.14.1861.0 - Stable v1.14.
v1.15.186
v1.15.200
v1.15.228
v1.15.252 - Stable v1.15.
Note: Skipped service releases.
Just a list for those who want to test the versions one by one.
If we can get exact versions where each of the issues started maybe we can bisect it to two commits. I don't see any other way forward for this year-old issue.
Personal Note: I have stopped seeing this issue since few weeks/months now so I can't debug it myself. Hence, the list for others. I am on 1.17.11461.0.
@zadjii-msft commented on GitHub (Aug 2, 2023):
I mean, I'm 100% certain it's one of the #2988 commits1 . Those are the ones that introduced the pseudo-hwnd (that's seemingly getting troubled here). Problem is, that's a pretty major compatibility feature that we definitely can't just revert. And there's not a simple opt-out, as I once thought there might be2 .
I don't have any ideas as to what we could do to mitigate this. I'd need to get someone to do a kernel trace with PGHook loaded to see exactly what they're calling. I wouldn't think that a 30s
Sleep, even at the start ofOpenConsole's launch, would affect the path I'm thinking of, but user32 is dark and full of terrors. I'd suspect that this wouldn't apply to "defterm" launches3 . Though, if they're hooking OpenConsole.exe, then... wouldn't that just hang all defterm console launches by 30s? That seems... insane.Those commits being:
- #12515, (the most likely culprit)
- #12526,
- #12799,
- #12899,
- Symbolic links created in additional panes/tabs don't work (#12900)
↩︎I previously thought it'd be possible to just pass a flag to conpty to disable creating the pseudo-hwnd (and revert to the old behavior). There was some reason I thought that would end up being Hard to do, though I can't remember why now. ↩︎
where you launch
cmd.exeand that boots into a Terminal window instead of a conhost one. That's available on Windows 11 and newer Windows 10 builds ↩︎@winni2k commented on GitHub (Aug 3, 2023):
I thought I'd post that this got fixed for me a few weeks back. I assume
it was a windows update of some kind. I tried to post at the time but
the comments seemed to have been disabled.
@trueuto commented on GitHub (Aug 17, 2023):
That may be a dead-end, but at some point 1.16.3463.0 release has changed the behaviour: from instant focus loss to a delayed one, by approx. 30 seconds. It was about when I initially thought the issue was completely gone. So, even if 1.16.3463.0 did not fix it, there was some change that seems to have impact on the problem by introducing that delay...
@winni2k commented on GitHub (Aug 17, 2023):
I also see a random focus loss every now and then. 30 seconds send about
right.
On August 17, 2023, "Maxime U. Garcia" @.***> wrote:
—
Reply to this email directly, view it on GitHub
<https://github.com/microsoft/terminal/issues/13388#issuecomment-
1681817862>, or unsubscribe
<https://github.com/notifications/unsubscribe-
auth/AACKOPQGRPHWPLMRV3GYDI3XVXFMPANCNFSM5Z6SZ2FQ>.
You are receiving this because you were mentioned.Message ID:
@.***>
--
Sent with HEY https://hey.com/sent
@trueuto commented on GitHub (Aug 17, 2023):
To be precise: in my case focus is only lost once per each new WT tab/window. In other words, if I start a new tab, focus gets stolen after 30 seconds, but then it does not re-occur until new WT tab/window is started.
@tomhallertech commented on GitHub (Sep 25, 2023):
I also lose focus in WSL constantlly. I have RSI and depend on using keyboard rather than mouse, and I can't even alt-tab to get the focus back - I have to actually click in the window, otherwise it's completely inaccessible. This is incredibly annoying. I would be using Linux on bare metal, not Windows at all, but my client thinks it's more secure to require all access to their systems to be via buggy vulnerable crappy software that just gets in the way of productivity. Please fix!
@prlcutting commented on GitHub (Sep 25, 2023):
I'm running
1.17.11461.0, and also regularly experiencing a loss of focus in the window. It's quite frustrating. My company also uses Beyond Trust.@tomhallertech commented on GitHub (Sep 26, 2023):
I'm also running Windows Terminal 1.17.11461.0, and have Beyond Trust, on Windows 10 Enterprise 22H2 Build 19045.3448. 30 seconds after I open a WSL tab, focus is lost. Other application windows are unaffected, I can alt-tab to them and type. But pressing tab or alt-tab does not regain focus in the WSL tab, only a mouse click will do. The same thing happens when I open a Powershell or Command Prompt tab. It also happens if I close all WSL tabs, execute "wsl --shutdown" in a command prompt, then open a Command Prompt or Powershell tab in Windows Terminal - focus is lost after 30 seconds and only a mouse click can restore. So problem seems to be with Windows Terminal, not WSL.
It's unclear from above comments whether this is necessarily to do with Beyond Trust. I can say however that I only experience this with Windows Terminal, no other application is similarly affected. In my normal workflow I open and close many WSL tabs, and I avoid using the mouse due to RSI, so this is both a usability and accessibility issue.
@ashpika40 commented on GitHub (Oct 3, 2023):
Yeah, I have been having this problem for a while as well. I've just updated to version 1.18.2681.0, but still see this problem. I do have BeyondTrust installed. For people who don't want to use a mouse to regain focus, you can do an ALT+F4 when it loses focus. This way you can close the invisible box and the focus automatically regains on to the most recent terminal you are working on.
@zoulja commented on GitHub (Oct 4, 2023):
Dear Windows Terminal developers, this is really really really annoying bug, and it's actually so surprisingly that MS releases applications with such seriuos and obvious issues (I hope it's not some single person pet project), so please please please fix it 🙏
@tomhallertech commented on GitHub (Oct 5, 2023):
Thank you, ashpika40, the ALT-F4 trick is brilliant!
My solution now is to open one instance of WT with WSL running in one tab, start tmux and use that for running multiple sessions, splitting windows into panes, etc. For a keyboard-centric user like me this works much better, and you can use the same skills outside of Windows, in pure Linux, ssh sessions, etc etc. I could even do the same thing in cmd.exe, but colors and fonts are nicer in WT.
@MrStrik3 commented on GitHub (Oct 5, 2023):
I would also like to add : if I open a new Windows Terminal tab or window, and quickly put the focus on a different application like Firefox, after a few seconds the application will lose its focus. The focus is brought to some kind of invisible tab in Windows Terminal
(I also have BeyondTrust, it might be related or a coincidence)
Thanks for looking into this problem, it's very appreciated!
@NinoDLC commented on GitHub (Nov 25, 2023):
Same problem here, also when commiting with Git.
git commit@zoulja commented on GitHub (Dec 11, 2023):
Any update on this, dear sirs?
@ilyaradko commented on GitHub (Dec 11, 2023):
@zoulja Yes. Someone should open a bug ticket at BeyondTrust :) They are actually aware that their Privilege Manager does not behave good with some software and constantly fixing it. Unless someone opens a bug ticket, they will not be aware of this misbehavior with WT.
@gsmalleus commented on GitHub (Dec 11, 2023):
I too am experiencing this behavior, but we do not utilize BeyondTrust.
If launched via a pinned Task Bar icon, the window opens but does not have focus for input without clicking.
If I launch it via the Start Menu, the window opens behind other open applications.
@zoulja commented on GitHub (Dec 12, 2023):
@ilyaradko I'm facing this bug on my home laptop and I don't have BeyondTrust installed, so actually no need to wait for someone to make it fixed. It's obviously a regression which was introduced a few versions ago
@rwasef1830 commented on GitHub (Dec 12, 2023):
I am facing this since few weeks ago, I am not using BeyondTrust, but I am using other software that perform injection techniques such as StartAllBack and Proxifier. I am on Windows 11.
Is there any low-level "who's asking for focus" tool to run so I can collect useful logs to add here ?
@trueuto commented on GitHub (Dec 12, 2023):
@rwasef1830 there were a couple possibilities mentioned earlier. You may want to refer to the following posts:
https://github.com/microsoft/terminal/issues/13388#issuecomment-1357415961
https://github.com/microsoft/terminal/issues/13388#issuecomment-1387106227
https://github.com/microsoft/terminal/issues/13388#issuecomment-1508701817
https://github.com/microsoft/terminal/issues/13388#issuecomment-1510915244
@zoulja commented on GitHub (Feb 27, 2024):
Still suffering of it in 1.20 Preview
@inglepriyanka148867 commented on GitHub (Apr 16, 2024):
To fix the issue where you can't type in new panes or tabs until manually clicking, check terminal emulator settings, tmux configuration, and shell settings for any conflicts or misconfigurations. Test with default settings, debug, and submit a fix if necessary.
@inglepriyanka148867 commented on GitHub (Apr 16, 2024):
Check Keyboard Focus Settings:
Sometimes, this issue can occur due to keyboard focus settings or accessibility settings. Make sure your keyboard settings are configured correctly.
Restart Windows Terminal:
Close Windows Terminal completely and reopen it. Sometimes, restarting the application can resolve temporary issues like this.
Check for Updates: Ensure that you're using the latest version of Windows Terminal. Older versions may have bugs or issues that have been fixed in newer releases.
Reset Windows Terminal Settings: If the issue persists, you can try resetting Windows Terminal settings to their defaults. This can often resolve configuration-related issues.
Check for Conflicting Software: Sometimes, conflicts with other software can cause issues with keyboard input. Make sure there are no conflicting applications or background processes interfering with Windows Terminal.
If none of these steps resolve the issue, you may need to further investigate or seek assistance from Microsoft support or community forums for Windows Terminal users.
@Delphier commented on GitHub (May 6, 2024):
1.19.11213, Windows 11 this issue still exists.
@MichaelMcCoyTech commented on GitHub (May 9, 2024):
Is anyone ever going to fix this issue. It is infuriating.
@wiz0u commented on GitHub (May 9, 2024):
Yeah, Terminal is basically unusable with Visual Studio console programs unless this is fixed. You don't want to need a mouse click when you run/debug your program with F5, before typing things in the console.
@asineth0 commented on GitHub (May 15, 2024):
I'm not sure why #13640 was closed since it is still an issue that happens on the latest version. This isn't the same issue either, but it was closed as a duplicate anyway by someone who's GH account has been deleted.
TL;DR: can we re-open #13640?
@trueuto commented on GitHub (Jun 27, 2024):
🎂 With a 2nd anniversary of this bug I wish everyone a quick breakthrough! It's been a pain in the neck for all users as well as developers as they are trying to fix something caused by the 3rd party apps in fact.
These words are primarily aimed at you, @zadjii-msft - I hope this will be solved soon and you can forget about that once and for all and focus on some other, most likely much more interesting work!
And thanks for all the efforts to have it sorted out!
@george-tsiros commented on GitHub (Jul 7, 2024):
Visual studio, start debugging console prog.
Terminal is configured to not use tabbed documents.
If another Terminal window is already open, new window is created unfocused.
If new window is the only Terminal window, it is focused.
@MichaelMcCoyTech commented on GitHub (Jul 7, 2024):
Please fix this. It is infuriating and causes me lots of failed logins etc. As you can never rely on terminal retaining focus as you are typing.
@Lionela26 commented on GitHub (Jul 12, 2024):
@justineakehurst commented on GitHub (Aug 1, 2024):
At it appears this is an interaction between Windows Terminal (reproducible with 1.20.11781.0) and BeyondTrust (reproducible with BeyondTrust Client version 23.9.225.0, PMC adapter 23.9.578) on Windows 11 Enterprise (10.0.22621 Build 22621), is it possible that the Terminal team can assemble an equivalent environment to get a repro, and work with BeyondTrust dev team to determine what might be going on here and find a solution?
@NinoDLC commented on GitHub (Aug 1, 2024):
I don't have BeyondTrust, I don't have any shitty bloatware installed, I even reformatted my computer since I had this issue, and it's still there, on a fresh windows 11 install. The only "exotic" stuff I have installed is WSL 2.0
@zoulja commented on GitHub (Aug 27, 2024):
Still not fixed in the latest Preview build ☹️
Now it's clear this app is cursed
@zadjii-msft commented on GitHub (Aug 29, 2024):
@NinoDLC FWIW there's a known issue in WSLg that causes the wslg interop to steal focus from the terminal whenever WSL starts up. This thread is specifically for the mysterious sources of focus being lost that don't involve WSL spawning.
Go see:
https://github.com/microsoft/wslg/issues/998
(et al)
@zadjii-msft commented on GitHub (Aug 29, 2024):
We merged in a fix that we think is tangential to this problem over in #17828 just today. It should be in this evening's Canary build. Tomorrow, could someone who was seeing the non-WSL focus lost issue test out Canary with a version greater than
1.23.2391.0? That might help us see if this fixed it or not.You can grab terminal canary from https://aka.ms/terminal-canary-installer
(we'll all be out for the long weekend, so I won't actually know the next canary's build number till like Tuesday)
@ashpika40 commented on GitHub (Aug 29, 2024):
I'd be happy to. Will do it tomorrow.
@trueuto commented on GitHub (Aug 30, 2024):
I have just tested the Canary version (1.23.2421.0) and it looks very good! 🎉
There STILL IS some focus loss, but it is very short (blink of an eye, literally) and focus immediately returns back to the WT. If that temporary focus loss is long enough to interfere with input - this I cannot tell. But definitely there is a great step forward! 💪
The temporary focus loss is manifested by the mouse cursor re-appearing on the screen (after it has disappeared on keyboard input) and if you use e.g. a red window background for inactive WT window - you can see it blink. This happens ~30 seconds after WT launch/new tab opened too.
@zadjii-msft commented on GitHub (Aug 30, 2024):
I'm super glad to hear it!
That sounds telltale like some other application is opening for an imperceivable amount of time, then immediately closing. We basically found a slower version of this that involved a git MSAL authentication prompt. That was a clearer example to trace of "another window appears briefly, then closes itself". I doubt whatever is spawning on your machine is an MSAL prompt, but I bet the side effects are similar.
We probably won't be able to do anything about that <1s gap where another window opens into the FG and steals focus, but this at least feels like it'll no longer be blocking for folks.
@trueuto commented on GitHub (Aug 30, 2024):
I will check it again with the script to detect focus-thief used in the past and let you know.
@trueuto commented on GitHub (Aug 30, 2024):
Tested with script from https://github.com/microsoft/terminal/issues/13388#issuecomment-1357415961
It seems it is the same story, where the focus is lost for the shell process that was started in the WT (pwsh in this case), but that happens for much <1s as can be seen above and focus goes immediately back to the WT itself.
@lhecker commented on GitHub (Aug 30, 2024):
That back-and-forth focus tossing is exactly what I was hoping to address with #17829. We'll probably merge that next week and see if that fixes the remaining issues.
@japurcell commented on GitHub (Aug 30, 2024):
In my case, Terminal works just fine until I open the Outlook Office 365 Client. I can navigate panes using keyboard shortcuts like
Alt + Up / Downbut can't select with mouse. Toolbar buttons are also disabled. When I close Outlook, it works just fine again. I also tried the Canary release mentioned above with the same results. I'm using the Outlook web client as a workaround.@jgilles commented on GitHub (Aug 30, 2024):
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!
On Fri, Aug 30, 2024 at 8:01 AM Adam Purcell @.***>
wrote:
@ashpika40 commented on GitHub (Aug 30, 2024):
It works. It still loses focus for a split second and comes back. If you keep typing when this happens you might loose a character, Other than that, excellent job. Finally, I will shift to Terminal completely . Tested on win 10 enterprise 22H2 with beyondTrust and using gitbash for testing
@trueuto commented on GitHub (Oct 1, 2024):
We were happy a bit too soon - there's another scenario we did not test: start Windows Terminal (or a new tab), switch to some other application and wait. This time WT steals focus and all the input goes to the WT console. Which is dangerous (e.g. when typing password, or the "rm -rf /foo/bar" command in the other window or app).
See the output from the PowerShell script (already used in the previous comments) below. Test steps taken - with the script started in the stand-alone Windows PowerShell window, i.e.: not in WT:
Unfortunately this new behaviour is even more annoying (and dangerous) than the old one...
EDIT: The initial WT handle and process provided above do not refer to WT; they were for the standalone PowerShell window. I have removed (xxxx) them not to cause confusion.
@P300pl commented on GitHub (Nov 1, 2024):
@trueuto commented on GitHub (Nov 16, 2024):
On Windows 11 I can still observe the focus theft with the latest WT (
1.21.2911.01.21.3231)@trueuto commented on GitHub (Nov 21, 2024):
@zadjii-msft - shall the previous behaviour of focus loss be
revertedrestored for the sake of security? The current one of focus theft seems really bad, far worse than the previous one. And IMHO more annoying too.@trueuto commented on GitHub (Feb 6, 2025):
Version: 1.22.10352.0 - still the same: focus is hijacked after ~30 seconds.
@EvilVir commented on GitHub (May 15, 2025):
Same here on 1.22.11141.0, any shell (PowerShell 7, CMD.exe, WSL, SSH).
@forghani77 commented on GitHub (May 21, 2025):
Same here on 1.22.11141.0, windows 10 22H2 (19045.5854) only on WSL
@DayKev commented on GitHub (Jan 14, 2026):
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).