Crash while pasting text into terminal window #18929

Closed
opened 2026-01-31 06:28:42 +00:00 by claunia · 10 comments
Owner

Originally created by @tolache on GitHub (Nov 19, 2022).

Windows Terminal version

1.15.2210.14005

Windows build number

10.0.22621

Other Software

No response

Steps to reproduce

  1. Paste any text into a terminal Window (Ctrl+V or right click).

Expected Behavior

Text pastes. Terminal doesn't crash.

Actual Behavior

Terminal crashes. Event 1000 from Application Error is logged:

Faulting application name: WindowsTerminal.exe, version: 1.15.2210.14005, time stamp: 0x6349fd20
Faulting module name: windows.applicationmodel.datatransfer.dll, version: 10.0.22621.1, time stamp: 0xd1b91d78
Exception code: 0xc0000005
Fault offset: 0x0000000000065009
Faulting process id: 0x0x3DC4
Faulting application start time: 0x0x1D8F8E77C39BCAB
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.15.2875.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\Windows\System32\windows.applicationmodel.datatransfer.dll
Report Id: 536af586-d6e2-4e58-a5c8-5bcf020c20b9
Faulting package full name: Microsoft.WindowsTerminal_1.15.2875.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

Also Event 1026 from .NET Runtime is logged:

Application: pwsh.exe
CoreCLR Version: 7.0.22.51805
.NET Version: 7.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
   at System.ConsolePal.ReadKey(Boolean intercept)
   at Microsoft.PowerShell.Internal.VirtualTerminal.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadOneOrMoreKeys()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKeyThreadProc()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

Restarting OS fixes it.

Originally created by @tolache on GitHub (Nov 19, 2022). ### Windows Terminal version 1.15.2210.14005 ### Windows build number 10.0.22621 ### Other Software _No response_ ### Steps to reproduce 1. Paste any text into a terminal Window (`Ctrl`+`V` or right click). ### Expected Behavior Text pastes. Terminal doesn't crash. ### Actual Behavior Terminal crashes. Event 1000 from Application Error is logged: ``` Faulting application name: WindowsTerminal.exe, version: 1.15.2210.14005, time stamp: 0x6349fd20 Faulting module name: windows.applicationmodel.datatransfer.dll, version: 10.0.22621.1, time stamp: 0xd1b91d78 Exception code: 0xc0000005 Fault offset: 0x0000000000065009 Faulting process id: 0x0x3DC4 Faulting application start time: 0x0x1D8F8E77C39BCAB Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.15.2875.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe Faulting module path: C:\Windows\System32\windows.applicationmodel.datatransfer.dll Report Id: 536af586-d6e2-4e58-a5c8-5bcf020c20b9 Faulting package full name: Microsoft.WindowsTerminal_1.15.2875.0_x64__8wekyb3d8bbwe Faulting package-relative application ID: App ``` Also Event 1026 from .NET Runtime is logged: ``` Application: pwsh.exe CoreCLR Version: 7.0.22.51805 .NET Version: 7.0.0 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read. at System.ConsolePal.ReadKey(Boolean intercept) at Microsoft.PowerShell.Internal.VirtualTerminal.ReadKey() at Microsoft.PowerShell.PSConsoleReadLine.ReadOneOrMoreKeys() at Microsoft.PowerShell.PSConsoleReadLine.ReadKeyThreadProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) ``` Restarting OS fixes it.
claunia added the Needs-TriageIssue-BugNeeds-Author-Feedback labels 2026-01-31 06:28:42 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 21, 2022):

If this is reproducible, can you try with closeOnExit: never? I wonder if pwsh is crashing, causing the singular Terminal tab to close, causing the window to exit.

If it does still repro, then we'll need a Feedback Hub trace: /feedback

@zadjii-msft commented on GitHub (Nov 21, 2022): If this is reproducible, can you try with [`closeOnExit: never`](https://learn.microsoft.com/en-us/windows/terminal/customize-settings/profile-advanced#profile-termination-behavior)? I wonder if pwsh is crashing, causing the singular Terminal tab to close, causing the window to exit. If it does still repro, then we'll need a Feedback Hub trace: /feedback
Author
Owner

@ghost commented on GitHub (Nov 21, 2022):

Hi there!

Can you please send us feedback with the Feedback Hub with this issue? Make sure to click the "Start recording" button, then reproduce the issue before submitting the feedback. Once it's submitted, paste the link here so we can more easily find your crash information on the back end?

Thanks!

image

image

image

@ghost commented on GitHub (Nov 21, 2022): Hi there!<br><br>Can you please send us feedback with the [Feedback Hub](https://support.microsoft.com/en-us/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332) with this issue? Make sure to click the "Start recording" button, then reproduce the issue before submitting the feedback. Once it's submitted, paste the link here so we can more easily find your crash information on the back end?<br><br>Thanks!<br><br>![image](https://user-images.githubusercontent.com/18356694/140811502-a068f78b-89d2-4587-925a-73e19652b830.png)<br><br>![image](https://user-images.githubusercontent.com/18356694/140811557-cdc22a0f-fa6a-4f6a-953e-73b51f5548a3.png)<br><br>![image](https://user-images.githubusercontent.com/18221333/62478649-6de55400-b760-11e9-806e-5aab7e085a9f.png)
Author
Owner

@tolache commented on GitHub (Nov 21, 2022):

So far, I've only had this issue once, and I don't know how to reproduce it on demand. I added the "closeOnExit" : "never" option to my settings.json > profiles > defaults in case the issue reproduces.

@tolache commented on GitHub (Nov 21, 2022): So far, I've only had this issue once, and I don't know how to reproduce it on demand. I added the `"closeOnExit" : "never"` option to my settings.json > profiles > defaults in case the issue reproduces.
Author
Owner

@zadjii-msft commented on GitHub (Nov 22, 2022):

I'm gonna leave this with Needs-Author-Feedback. If this never comes back, then great! If it does, we can always reopen once there's more information to work with.

@zadjii-msft commented on GitHub (Nov 22, 2022): I'm gonna leave this with `Needs-Author-Feedback`. If this never comes back, then great! If it does, we can always reopen once there's more information to work with.
Author
Owner

@ghost commented on GitHub (Nov 26, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Nov 26, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@wisemanny commented on GitHub (Dec 6, 2022):

I can add to that - every time I close my Surface Book 3, or when it goes to sleep open, after I log in back to my session I see that all pwsh.exe tabs are gone and WT is closed as well. I need to start it again. I do not how to reproduce it since it requies going to sleep.

Application: pwsh.exe
CoreCLR Version: 7.0.22.51805
.NET Version: 7.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
   at System.ConsolePal.ReadKey(Boolean intercept)
   at Microsoft.PowerShell.Internal.VirtualTerminal.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadOneOrMoreKeys()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKeyThreadProc()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

Here is another event message:

Faulting application name: pwsh.exe, version: 7.3.0.500, time stamp: 0x634eda42
Faulting module name: KERNELBASE.dll, version: 10.0.22621.900, time stamp: 0xba3bd2f7
Exception code: 0xe0434352
Fault offset: 0x00000000000903ec
Faulting process id: 0x0x3250
Faulting application start time: 0x0x1D909543CE0B03E
Faulting application path: C:\Program Files\PowerShell\7\pwsh.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 3cd16139-6b3f-4d6e-b838-87c5b1932f9c
Faulting package full name: 
Faulting package-relative application ID: 

Let me know how can I help tracing it down to the root cause.

@wisemanny commented on GitHub (Dec 6, 2022): I can add to that - every time I close my Surface Book 3, or when it goes to sleep open, after I log in back to my session I see that all pwsh.exe tabs are gone and WT is closed as well. I need to start it again. I do not how to reproduce it since it requies going to sleep. ``` Application: pwsh.exe CoreCLR Version: 7.0.22.51805 .NET Version: 7.0.0 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read. at System.ConsolePal.ReadKey(Boolean intercept) at Microsoft.PowerShell.Internal.VirtualTerminal.ReadKey() at Microsoft.PowerShell.PSConsoleReadLine.ReadOneOrMoreKeys() at Microsoft.PowerShell.PSConsoleReadLine.ReadKeyThreadProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) ``` Here is another event message: ``` Faulting application name: pwsh.exe, version: 7.3.0.500, time stamp: 0x634eda42 Faulting module name: KERNELBASE.dll, version: 10.0.22621.900, time stamp: 0xba3bd2f7 Exception code: 0xe0434352 Fault offset: 0x00000000000903ec Faulting process id: 0x0x3250 Faulting application start time: 0x0x1D909543CE0B03E Faulting application path: C:\Program Files\PowerShell\7\pwsh.exe Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll Report Id: 3cd16139-6b3f-4d6e-b838-87c5b1932f9c Faulting package full name: Faulting package-relative application ID: ``` Let me know how can I help tracing it down to the root cause.
Author
Owner

@wisemanny commented on GitHub (Dec 6, 2022):

I have crashdump files, let me know how to send them to you:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           12/4/2022  8:27 PM        2516883 BattMonUI.exe.896.dmp
-a---           12/6/2022  2:21 PM        6728840 pwsh.exe.12880.dmp
-a---           12/6/2022  2:21 PM        7108647 pwsh.exe.14556.dmp
-a---           12/5/2022  5:48 PM        6921187 pwsh.exe.17304.dmp
-a---           12/3/2022  9:05 PM        6651576 pwsh.exe.17824.dmp
-a---           12/5/2022  5:48 PM        7264709 pwsh.exe.19560.dmp
-a---           12/4/2022  5:23 PM        6632741 pwsh.exe.22484.dmp
-a---           12/5/2022  8:35 PM        6699049 pwsh.exe.6360.dmp
-a---           12/5/2022  5:48 PM        6735171 pwsh.exe.6592.dmp
-a---           12/5/2022  7:31 PM        7017435 pwsh.exe.9936.dmp

I run the terminal with DOTNET_DbgEnableMiniDump env set to 1. That should generate .net crashdump.

@wisemanny commented on GitHub (Dec 6, 2022): I have crashdump files, let me know how to send them to you: ``` Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 12/4/2022 8:27 PM 2516883 BattMonUI.exe.896.dmp -a--- 12/6/2022 2:21 PM 6728840 pwsh.exe.12880.dmp -a--- 12/6/2022 2:21 PM 7108647 pwsh.exe.14556.dmp -a--- 12/5/2022 5:48 PM 6921187 pwsh.exe.17304.dmp -a--- 12/3/2022 9:05 PM 6651576 pwsh.exe.17824.dmp -a--- 12/5/2022 5:48 PM 7264709 pwsh.exe.19560.dmp -a--- 12/4/2022 5:23 PM 6632741 pwsh.exe.22484.dmp -a--- 12/5/2022 8:35 PM 6699049 pwsh.exe.6360.dmp -a--- 12/5/2022 5:48 PM 6735171 pwsh.exe.6592.dmp -a--- 12/5/2022 7:31 PM 7017435 pwsh.exe.9936.dmp ``` I run the terminal with DOTNET_DbgEnableMiniDump env set to 1. That should generate .net crashdump.
Author
Owner

@wisemanny commented on GitHub (Dec 7, 2022):

I had 3 tabs open - 2 pwsh and 1 cmd. pwsh crashed, but WT closed as well even though there was one cmd.exe tab. .net crash dump was not generated unfortunately.

@wisemanny commented on GitHub (Dec 7, 2022): I had 3 tabs open - 2 pwsh and 1 cmd. pwsh crashed, but WT closed as well even though there was one cmd.exe tab. .net crash dump was not generated unfortunately.
Author
Owner

@DHowett commented on GitHub (Dec 7, 2022):

@wisemanny it might be better for you to open a new bug! It looks like Terminal is crashing in response to PowerShell crashing, whereas the original report here was that it crashes directly as a result of the paste. It's an interesting distinction, and might apply to other cases where PowerShell exits.

@DHowett commented on GitHub (Dec 7, 2022): @wisemanny it might be better for you to open a new bug! It looks like Terminal is crashing in response to PowerShell crashing, whereas the original report here was that it crashes _directly as a result of the paste._ It's an interesting distinction, and might apply to other cases where PowerShell exits.
Author
Owner

@wisemanny commented on GitHub (Dec 7, 2022):

Got it. Will do more testing and open a new bug then.

@wisemanny commented on GitHub (Dec 7, 2022): Got it. Will do more testing and open a new bug then.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18929