terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Unexplained crash while copying with the terminal

Open zhangyuyaoyy opened this issue 7 years ago • 27 comments

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.

zhangyuyaoyy avatar Jul 17 '19 10:07 zhangyuyaoyy

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 avatar Jul 17 '19 13:07 zadjii-msft

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

QuantumZain avatar Jul 17 '19 20:07 QuantumZain

@QuantumZain I believe that's done intentionally see: https://github.com/microsoft/terminal/blob/9b92986b49bed8cc41fde4d6ef080921c41e6d9e/src/host/input.cpp#L112-L129

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.

rv32ima avatar Jul 18 '19 21:07 rv32ima

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.

breakid avatar Jul 21 '19 21:07 breakid

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 avatar Jul 25 '19 22:07 ghost

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.

LongLiveCHIEF avatar Jul 27 '19 17:07 LongLiveCHIEF

n/m, 1831 is the latest build.

LongLiveCHIEF avatar Jul 27 '19 17:07 LongLiveCHIEF

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

LongLiveCHIEF avatar Jul 27 '19 17:07 LongLiveCHIEF

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.

DHowett-MSFT avatar Jul 29 '19 20:07 DHowett-MSFT

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

mdx0111 avatar Jul 30 '19 16:07 mdx0111

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.

zadjii-msft avatar Jul 30 '19 16:07 zadjii-msft

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.

mdx0111 avatar Jul 31 '19 08:07 mdx0111

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 avatar Aug 01 '19 21:08 miniksa

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.

darkmacheken avatar Aug 01 '19 23:08 darkmacheken

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.

mikeymop avatar Aug 03 '19 18:08 mikeymop

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

duydao avatar Aug 04 '19 13:08 duydao

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

Yes, that got into v0.3

darkmacheken avatar Aug 04 '19 17:08 darkmacheken

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.

devstu avatar Aug 06 '19 01:08 devstu

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

DHowett-MSFT avatar Aug 06 '19 01:08 DHowett-MSFT

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.

devstu avatar Aug 06 '19 01:08 devstu