Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexplained crash while copying with the terminal #2000

Closed
zyyBjtu opened this issue Jul 17, 2019 · 27 comments
Closed

Unexplained crash while copying with the terminal #2000

zyyBjtu opened this issue Jul 17, 2019 · 27 comments
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal.

Comments

@zyyBjtu
Copy link

zyyBjtu commented Jul 17, 2019

You can't copy and paste with windows terminal. Normally you can paste and copy with the right mouse button, but at some point it will cause terminal to crash.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 17, 2019
@zadjii-msft
Copy link
Member

There were a couple bugfixes in this area recently. What build of Windows Terminal are you running?

What steps are you taking to get the terminal to crash while selecting?

@carlos-zamora may be interested.

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 17, 2019
@QuantumZain
Copy link

I also have the same issue unable to copy from cmd nor paste to it, but instead of crashing, it outputs:
^V
for Ctrl + V.
where as for Ctrl + C (when selecting text) it performs the same behavior when text isn't selected

@ellie-idb
Copy link

@QuantumZain I believe that's done intentionally see:

terminal/src/host/input.cpp

Lines 112 to 129 in 9b92986

if (keyEvent.IsCtrlPressed() &&
!keyEvent.IsAltPressed() &&
keyEvent.IsKeyDown())
{
// check for ctrl-c, if in line input mode.
if (keyEvent.GetVirtualKeyCode() == 'C' && IsInProcessedInputMode())
{
HandleCtrlEvent(CTRL_C_EVENT);
if (gci.PopupCount == 0)
{
gci.pInputBuffer->TerminateRead(WaitTerminationReason::CtrlC);
}
if (!(WI_IsFlagSet(gci.Flags, CONSOLE_SUSPENDED)))
{
ContinueProcessing = false;
}
}

A simple check if IsSelectionActive() would fix this, but in most cases you would prefer NOT to break interrupting (since Ctrl+C is effectively sending a SIGINT). Try rebinding to Ctrl+Shift+C/Ctrl+Shift+V instead.

@breakid
Copy link

breakid commented Jul 21, 2019

Copy/paste works in the version currently on the Windows Store (as of 2019-07-21; 0.2.1831.0), you just don't use CTRL+C/V. Highlight the text you want to copy, then right click; it will automatically copy. Then right-click again to paste in the Terminal or CTRL+V in your other application of choice.

I assume this was done intentionally as PuTTY and various other Linux terminals use the same mechanic.

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jul 25, 2019
@ghost
Copy link

ghost commented Jul 25, 2019

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.

@LongLiveCHIEF
Copy link

LongLiveCHIEF commented Jul 27, 2019

I'm experiencing this issue as well, running 0.2.1831.0. I'll try to update to latest build and see if it resolves issue.

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jul 27, 2019
@LongLiveCHIEF
Copy link

n/m, 1831 is the latest build.

@LongLiveCHIEF
Copy link

specific action I'm trying to do is copy from system clipboard into vim that's open in WSL2 Ubuntu.

@DHowett-MSFT
Copy link
Contributor

You can do that with right click. Is it crashing? Do you have any events about "Windows Error Reporting" in your event log? If so, please share: they contain vital information that we can use to find your crash.

@mdx0111
Copy link

mdx0111 commented Jul 30, 2019

Would CTRL+Shift+C and CTRL+Shift+V be good candidates to be added to perform Copy and Paste please?

@zadjii-msft
Copy link
Member

They already are the keybindings, as of #1093.

I'd really like to see a stack or some info to help us track down the source of the crash reported in OP. Without more info,there's nothing more we can really do with this issue.

@mdx0111
Copy link

mdx0111 commented Jul 31, 2019

Thanks for your reply.

I'm on the latest release but the CTRL+Shift+C and CTRL+Shift+V don't work for me at all to do copy/paste. Having said that, I tried copy/paste via mouse clicks a lot and never encountered any issues.

@miniksa miniksa added Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Aug 1, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 1, 2019
@miniksa miniksa removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Aug 1, 2019
@miniksa
Copy link
Member

miniksa commented Aug 1, 2019

The only part here we're actively still looking for is information on the crash that @zyyBjtu experienced.

The issues with the keybindings are getting resolved in other PRs and in the upcoming 0.3 release.

We want to know more about this crash.

@miniksa miniksa added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 1, 2019
@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 1, 2019
@darkmacheken
Copy link

darkmacheken commented Aug 1, 2019

Just to know, currently, is there any keybinding to copy and paste using the terminal? Will it be possible to change the keybindings to copy and paste text in the profiles.json?
Also, I've randomly been experiencing some crashes using the windows clipboard using tmux and vim, where clip.exe crashes with error code 0xc0000142. As it is random I didn't find any probable cause, so, haven't open an issue yet.

@mikeymop
Copy link

mikeymop commented Aug 3, 2019

Ctrl+C is problematic because ^c is an interrupt signal.

However I also observed that selection is copy, and right click is paste. I believe here having the native windows right click context menu would be nice.

@duydao
Copy link

duydao commented Aug 4, 2019

@pedrodaniel10 Ctrl+Chift+C / Ctrl+Chift+V works for me

@darkmacheken
Copy link

@pedrodaniel10 Ctrl+Chift+C / Ctrl+Chift+V works for me

Yes, that got into v0.3

@devstu
Copy link

devstu commented Aug 6, 2019

I would like to see customizable key commands for copy and paste.
GitBash uses Ctrl+Ins and Shift+Ins and it seems pretty universal in a lot of apps.

@DHowett-MSFT
Copy link
Contributor

@devstu you must mean the new customizable key bindings for copy and paste that went into v0.3?

@zadjii-msft zadjii-msft changed the title You can't copy and paste with windows terminal. Unexplained crash while copying with the terminal Aug 6, 2019
@devstu
Copy link

devstu commented Aug 6, 2019

I am sorry I found it now, it wasn't in the default keybindinds, but I added one for copy and paste and it worked. Thank you, sorry.

@ghost
Copy link

ghost commented Aug 10, 2019

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 ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 10, 2019
@ghost ghost closed this as completed Aug 13, 2019
@visceralfield
Copy link

I am still experiencing this crash. When I right-click to copy text from a Powershell instance in Windows Terminal, I get the loading ring cursor for a few seconds, the window closes, and nothing is copied to my clipboard. Where should I look to get the relevant logs for debugging this issue?

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Sep 9, 2019
@visceralfield
Copy link

This is the Event Viewer data for the crash:

Faulting application name: WindowsTerminal.exe, version: 1.0.1908.26002, time stamp: 0x5d641823
Faulting module name: CoreMessaging.dll, version: 10.0.18362.1, time stamp: 0x101a45b8
Exception code: 0xc000027b
Fault offset: 0x000000000005fe7e
Faulting process id: 0x2dd0
Faulting application start time: 0x01d56724c022ac87
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.4.2382.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\Windows\System32\CoreMessaging.dll
Report Id: 4003ef47-2e4f-45dd-bf0a-42c998a95924
Faulting package full name: Microsoft.WindowsTerminal_0.4.2382.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

@visceralfield
Copy link

And this is the associated Report.wer:

Report.zip

@tolache
Copy link

tolache commented Nov 15, 2022

My terminal crashes upon pasting a string. I have an Even 1000 from Application Error:

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

and an Event 1026 from .NET Runtime:

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)

@zadjii-msft
Copy link
Member

@tolache This is a 3 year old stale issue about an unexplained crash while copying text. You should probably file a new issue, so we can triage your issue to its own root cause.

@tolache
Copy link

tolache commented Nov 19, 2022

#14412, for anyone else who finds this.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests