Ternimal window cannot be restored after minimized #22494

Closed
opened 2026-01-31 08:15:04 +00:00 by claunia · 2 comments
Owner

Originally created by @YueLu0116 on GitHub (Nov 5, 2024).

Windows Terminal version

1.21.2911.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

Minimized the Ternimal window, after a while, the window cannot be restored. The process seems hang.

Expected Behavior

The window can be restored and show up.

Actual Behavior

I'm not sure if it is due to the EDR software (SentinelOne, inject InProcessClient64.dll into processes) provided by my company or it is just a bug of Terminal. Some suspicious threads stacks:

.  0  Id: a224.8cf8 Suspend: 0 Teb: 0000007e`d0a0e000 Unfrozen
win32u!NtUserGetMessage+0x14
user32!GetMessageW+0x2a
InProcessClient64+0xce386
InProcessClient64+0xce2c5
WindowsTerminal!WindowEmperor::WaitForWindows+0x6a [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowEmperor.cpp @ 128] 
WindowsTerminal!WindowEmperor::HandleCommandlineArgs+0x233 [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowEmperor.cpp @ 103] 
WindowsTerminal!wWinMain+0xab [C:\__w\1\s\src\cascadia\WindowsTerminal\main.cpp @ 125] 
WindowsTerminal!invoke_main+0x21 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 118] 
WindowsTerminal!__scrt_common_main_seh+0x106 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] 
kernel32!BaseThreadInitThunk+0x1d
ntdll!RtlUserThreadStart+0x28
13  Id: a224.91c8 Suspend: 0 Teb: 0000007e`d0a40000 Unfrozen "Window Thread"
ntdll!NtWaitForSingleObject+0x14
KERNELBASE!WaitForSingleObjectEx+0x8e
SHCore!WorkThreadManager::CThread::WaitForThreadStart+0x28
SHCore!WorkThreadManager::s_QueuePoolTask+0x21d
SHCore!SHTaskPoolQueueTask+0xef
twinapi_appcore!CustomMaterialProps::put_DesiredHostBackdropTransparencyPolicy+0x16a
Windows_UI_Xaml!<lambda_5a8ae7e5b565006a16d01e826a62972b>::operator()+0x149 [onecoreuap\windows\dxaml\xcp\core\core\elements\xamlislandroot.cpp @ 189] 
Windows_UI_Xaml!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::IInputActivationListener *>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *> >::*)(Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *)>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *>,Microsoft::WRL::FtmBase>,<lambda_5a8ae7e5b565006a16d01e826a62972b> &,-1,Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *>::Invoke+0xf [onecore\external\sdk\inc\wrl\event.h @ 354] 
InputHost!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::IInputActivationListener *>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *> >::*)(Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *)>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *>,Microsoft::WRL::FtmBase>,<lambda_cb3a7d5c10a5c2b5a96abaf0ec526ed3>,-1,Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *>::Invoke+0x7b
InputHost!Microsoft::WRL::InvokeTraits<-2>::InvokeDelegates<<lambda_ffe04bc5969071cd952ce58086b937a1>,Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *> >+0x80
InputHost!Microsoft::WRL::EventSource<Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *>,Microsoft::WRL::InvokeModeOptions<-2> >::DoInvoke<<lambda_ffe04bc5969071cd952ce58086b937a1> >+0x75
InputHost!Microsoft::WRL2::ContextSession::LeaveSession_Callback<<lambda_7797ef9b8212c8ed2c362ee6b89ee907> >+0xf5
InputHost!InputActivationListenerWinRT::ActivationListenerInputObjectOwnerInterop::OnBamoActivate+0x239
InputHost!ActivationListenerInputObject::OnActivate+0x27
InputHost!IActivationListenerInputObjectPrincipal_Receive<BamoImpl::BamoActivationListenerInputObjectPrincipalImpl>::Thunk_OnActivate_16+0xab
CoreMessaging!CoreUICallReceive+0xa0
InputHost!BamoImpl::BamoActivationListenerInputObjectPrincipalImpl::OnMessage+0x3f
InputHost!Microsoft::BamoImpl::ConnectionIndirector::OnItemMessage+0xcd
CoreMessaging!CFlat::SehSafe::Execute<<lambda_de6cc8128f8f9f99144226758963eeb9> >+0x5c
CoreMessaging!Microsoft::CoreUI::ICallbackMessageConversationHost::Interface$::ImportDispatcher::OnItemMessage+0x12c
CoreMessaging!Microsoft::CoreUI::ICallbackMessageConversationHost::Interface$::StaticDispatcher::OnItemMessage+0x16a
CoreMessaging!Microsoft::CoreUI::Conversations::ItemMessageDispatcher::Callback_OnMessageCore+0xf7
CoreMessaging!Microsoft::CoreUI::Messaging::MessageSession::Callback_DeliverMessage+0x2be
CoreMessaging!Microsoft::CoreUI::Messaging::MessageSession::Callback_DeliverMessageBatch+0x125
CoreMessaging!Microsoft::CoreUI::Messaging::AlpcClientSender::Callback_ProcessBuffer+0x1ce
CoreMessaging!Microsoft::CoreUI::Messaging::AlpcClientThunk::Callback_ProcessAsynchronousBuffer+0x1b
CoreMessaging!AlpcConnection::Callback_HandleReceivedBuffer+0x14d
CoreMessaging!AlpcConnection::Callback_ProcessIncoming+0x26d
CoreMessaging!`CFlat::DelegateImpl<System::Action,0,void __cdecl(void),void,0>::Bind<CFlat::SmartPtr<Microsoft::CoreUI::Messaging::AlpcClientSender>,&Microsoft::CoreUI::Messaging::AlpcClientSender::Callback_OnReceive>'::`2'::Thunk::Invoke+0x48
CoreMessaging!Microsoft::CoreUI::Dispatch::OffThreadReceiver::Callback_OnDispatch+0x1bc
CoreMessaging!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop+0x36f
CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch+0x1f3
CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::DoWork+0x206
CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::WindowProc+0x14c
user32!UserCallWinProcCheckWow+0x2d1
user32!DispatchClientMessage+0x9c
user32!_fnDWORD+0x3d
ntdll!KiUserCallbackDispatcherContinue
win32u!NtUserGetMessage+0x14
user32!GetMessageW+0x2a
InProcessClient64+0xce386
InProcessClient64+0xce2c5
WindowsTerminal!WindowThread::_messagePump+0x1fe [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowThread.cpp @ 185] 
WindowsTerminal!WindowThread::RunMessagePump+0x8 [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowThread.cpp @ 48] 
WindowsTerminal!`WindowEmperor::_createNewWindowThread'::`2'::<lambda_1>::operator()+0x426 [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowEmperor.cpp @ 228] 
WindowsTerminal!std::invoke+0x5 [C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\include\type_traits @ 1704] 
WindowsTerminal!std::thread::_Invoke<std::tuple<`WindowEmperor::_createNewWindowThread'::`2'::<lambda_1> >,0>+0xe [C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\include\thread @ 61] 
ucrtbase!thread_start<unsigned int (__cdecl*)(void *),1>+0x93
kernel32!BaseThreadInitThunk+0x1d
ntdll!RtlUserThreadStart+0x28
60  Id: a224.b21c Suspend: 0 Teb: 0000007e`d0ba0000 Unfrozen "ConptyConnection Output Thread"
ntdll!NtReadFile+0x14
KERNELBASE!ReadFile+0x7b
TerminalConnection!winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::_OutputThread+0x25e [C:\__w\1\s\src\cascadia\TerminalConnection\ConptyConnection.cpp @ 611] 
TerminalConnection!winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::Start::__l3::<lambda_1>::operator()+0xa [C:\__w\1\s\src\cascadia\TerminalConnection\ConptyConnection.cpp @ 385] 
TerminalConnection!`winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::Start'::`3'::<lambda_1>::<lambda_invoker_cdecl>+0xe [C:\__w\1\s\src\cascadia\TerminalConnection\ConptyConnection.cpp @ 388] 
kernel32!BaseThreadInitThunk+0x1d
ntdll!RtlUserThreadStart+0x28
Originally created by @YueLu0116 on GitHub (Nov 5, 2024). ### Windows Terminal version 1.21.2911.0 ### Windows build number 10.0.22621.0 ### Other Software _No response_ ### Steps to reproduce Minimized the Ternimal window, after a while, the window cannot be restored. The process seems hang. ### Expected Behavior The window can be restored and show up. ### Actual Behavior I'm not sure if it is due to the EDR software (SentinelOne, inject InProcessClient64.dll into processes) provided by my company or it is just a bug of Terminal. Some suspicious threads stacks: ``` . 0 Id: a224.8cf8 Suspend: 0 Teb: 0000007e`d0a0e000 Unfrozen win32u!NtUserGetMessage+0x14 user32!GetMessageW+0x2a InProcessClient64+0xce386 InProcessClient64+0xce2c5 WindowsTerminal!WindowEmperor::WaitForWindows+0x6a [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowEmperor.cpp @ 128] WindowsTerminal!WindowEmperor::HandleCommandlineArgs+0x233 [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowEmperor.cpp @ 103] WindowsTerminal!wWinMain+0xab [C:\__w\1\s\src\cascadia\WindowsTerminal\main.cpp @ 125] WindowsTerminal!invoke_main+0x21 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 118] WindowsTerminal!__scrt_common_main_seh+0x106 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] kernel32!BaseThreadInitThunk+0x1d ntdll!RtlUserThreadStart+0x28 ``` ``` 13 Id: a224.91c8 Suspend: 0 Teb: 0000007e`d0a40000 Unfrozen "Window Thread" ntdll!NtWaitForSingleObject+0x14 KERNELBASE!WaitForSingleObjectEx+0x8e SHCore!WorkThreadManager::CThread::WaitForThreadStart+0x28 SHCore!WorkThreadManager::s_QueuePoolTask+0x21d SHCore!SHTaskPoolQueueTask+0xef twinapi_appcore!CustomMaterialProps::put_DesiredHostBackdropTransparencyPolicy+0x16a Windows_UI_Xaml!<lambda_5a8ae7e5b565006a16d01e826a62972b>::operator()+0x149 [onecoreuap\windows\dxaml\xcp\core\core\elements\xamlislandroot.cpp @ 189] Windows_UI_Xaml!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::IInputActivationListener *>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *> >::*)(Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *)>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *>,Microsoft::WRL::FtmBase>,<lambda_5a8ae7e5b565006a16d01e826a62972b> &,-1,Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *>::Invoke+0xf [onecore\external\sdk\inc\wrl\event.h @ 354] InputHost!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::IInputActivationListener *>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *> >::*)(Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *)>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *>,Microsoft::WRL::FtmBase>,<lambda_cb3a7d5c10a5c2b5a96abaf0ec526ed3>,-1,Windows::UI::Input::IInputActivationListener *,Windows::UI::Input::IInputActivationListenerActivationChangedEventArgs *>::Invoke+0x7b InputHost!Microsoft::WRL::InvokeTraits<-2>::InvokeDelegates<<lambda_ffe04bc5969071cd952ce58086b937a1>,Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *> >+0x80 InputHost!Microsoft::WRL::EventSource<Windows::Foundation::ITypedEventHandler<Windows::UI::Input::InputActivationListener *,Windows::UI::Input::InputActivationListenerActivationChangedEventArgs *>,Microsoft::WRL::InvokeModeOptions<-2> >::DoInvoke<<lambda_ffe04bc5969071cd952ce58086b937a1> >+0x75 InputHost!Microsoft::WRL2::ContextSession::LeaveSession_Callback<<lambda_7797ef9b8212c8ed2c362ee6b89ee907> >+0xf5 InputHost!InputActivationListenerWinRT::ActivationListenerInputObjectOwnerInterop::OnBamoActivate+0x239 InputHost!ActivationListenerInputObject::OnActivate+0x27 InputHost!IActivationListenerInputObjectPrincipal_Receive<BamoImpl::BamoActivationListenerInputObjectPrincipalImpl>::Thunk_OnActivate_16+0xab CoreMessaging!CoreUICallReceive+0xa0 InputHost!BamoImpl::BamoActivationListenerInputObjectPrincipalImpl::OnMessage+0x3f InputHost!Microsoft::BamoImpl::ConnectionIndirector::OnItemMessage+0xcd CoreMessaging!CFlat::SehSafe::Execute<<lambda_de6cc8128f8f9f99144226758963eeb9> >+0x5c CoreMessaging!Microsoft::CoreUI::ICallbackMessageConversationHost::Interface$::ImportDispatcher::OnItemMessage+0x12c CoreMessaging!Microsoft::CoreUI::ICallbackMessageConversationHost::Interface$::StaticDispatcher::OnItemMessage+0x16a CoreMessaging!Microsoft::CoreUI::Conversations::ItemMessageDispatcher::Callback_OnMessageCore+0xf7 CoreMessaging!Microsoft::CoreUI::Messaging::MessageSession::Callback_DeliverMessage+0x2be CoreMessaging!Microsoft::CoreUI::Messaging::MessageSession::Callback_DeliverMessageBatch+0x125 CoreMessaging!Microsoft::CoreUI::Messaging::AlpcClientSender::Callback_ProcessBuffer+0x1ce CoreMessaging!Microsoft::CoreUI::Messaging::AlpcClientThunk::Callback_ProcessAsynchronousBuffer+0x1b CoreMessaging!AlpcConnection::Callback_HandleReceivedBuffer+0x14d CoreMessaging!AlpcConnection::Callback_ProcessIncoming+0x26d CoreMessaging!`CFlat::DelegateImpl<System::Action,0,void __cdecl(void),void,0>::Bind<CFlat::SmartPtr<Microsoft::CoreUI::Messaging::AlpcClientSender>,&Microsoft::CoreUI::Messaging::AlpcClientSender::Callback_OnReceive>'::`2'::Thunk::Invoke+0x48 CoreMessaging!Microsoft::CoreUI::Dispatch::OffThreadReceiver::Callback_OnDispatch+0x1bc CoreMessaging!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop+0x36f CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch+0x1f3 CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::DoWork+0x206 CoreMessaging!Microsoft::CoreUI::Dispatch::UserAdapter::WindowProc+0x14c user32!UserCallWinProcCheckWow+0x2d1 user32!DispatchClientMessage+0x9c user32!_fnDWORD+0x3d ntdll!KiUserCallbackDispatcherContinue win32u!NtUserGetMessage+0x14 user32!GetMessageW+0x2a InProcessClient64+0xce386 InProcessClient64+0xce2c5 WindowsTerminal!WindowThread::_messagePump+0x1fe [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowThread.cpp @ 185] WindowsTerminal!WindowThread::RunMessagePump+0x8 [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowThread.cpp @ 48] WindowsTerminal!`WindowEmperor::_createNewWindowThread'::`2'::<lambda_1>::operator()+0x426 [C:\__w\1\s\src\cascadia\WindowsTerminal\WindowEmperor.cpp @ 228] WindowsTerminal!std::invoke+0x5 [C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\include\type_traits @ 1704] WindowsTerminal!std::thread::_Invoke<std::tuple<`WindowEmperor::_createNewWindowThread'::`2'::<lambda_1> >,0>+0xe [C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\include\thread @ 61] ucrtbase!thread_start<unsigned int (__cdecl*)(void *),1>+0x93 kernel32!BaseThreadInitThunk+0x1d ntdll!RtlUserThreadStart+0x28 ``` ``` 60 Id: a224.b21c Suspend: 0 Teb: 0000007e`d0ba0000 Unfrozen "ConptyConnection Output Thread" ntdll!NtReadFile+0x14 KERNELBASE!ReadFile+0x7b TerminalConnection!winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::_OutputThread+0x25e [C:\__w\1\s\src\cascadia\TerminalConnection\ConptyConnection.cpp @ 611] TerminalConnection!winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::Start::__l3::<lambda_1>::operator()+0xa [C:\__w\1\s\src\cascadia\TerminalConnection\ConptyConnection.cpp @ 385] TerminalConnection!`winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::Start'::`3'::<lambda_1>::<lambda_invoker_cdecl>+0xe [C:\__w\1\s\src\cascadia\TerminalConnection\ConptyConnection.cpp @ 388] kernel32!BaseThreadInitThunk+0x1d ntdll!RtlUserThreadStart+0x28 ```
claunia added the Needs-TriageIssue-BugResolution-External labels 2026-01-31 08:15:04 +00:00
Author
Owner

@carlos-zamora commented on GitHub (Nov 6, 2024):

Thanks for filing. We think this may be related to the EDR software you mentioned. It may be worth contacting your IT department and engaging SentinelOne's customer support.

@carlos-zamora commented on GitHub (Nov 6, 2024): Thanks for filing. We think this may be related to the EDR software you mentioned. It may be worth contacting your IT department and engaging SentinelOne's customer support.
Author
Owner

@DHowett commented on GitHub (Nov 6, 2024):

Sorry if that seemed dismissive! This resolution was informed by your first stack trace (thanks for calling out InProcessClient64!) as well as us not having seen other reports of this. I did have a quick look at our crash and hang reports, and couldn't find anything that seemed like a smoking gun on our side.

@DHowett commented on GitHub (Nov 6, 2024): Sorry if that seemed dismissive! This resolution was informed by your first stack trace (thanks for calling out `InProcessClient64`!) as well as us not having seen other reports of this. I did have a quick look at our crash and hang reports, and couldn't find anything that seemed like a smoking gun on our side.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22494