Conemu: Pasting in ConEmu doesn't work as expected

Created on 4 Jan 2018  路  21Comments  路  Source: Maximus5/ConEmu

Versions

ConEmu build: 171025 x64
OS version: Windows 10 x64
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): win10 builtin bash

Problem description

When pasting content, be it multi-line or not, ConEmu drop parts of it. This used to work properly, so something regressed at some point, but I do not know exactly what.

For instance, when pasting:

sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp

The following text gets pasted:

cure_randbits(/InsecureRandBits(src/wallet/test/*.cpp

This makes working with terminal much more tedious than it needs to be. It's not even clear why various parts are getting dropped.

Steps to reproduce

  1. Open the win10 integrated bash command line.
  2. paste the text using ctrl+V or using the mouse.

Actual results

Part of the text is dropped.

Expected results

The text pasted should match the text copied.

other-windows

Most helpful comment

I found a solution changing in Settings > Keys & Macro > Paste all paste mode to Multi lines

All 21 comments

That is an Microsoft conhost bug reported regularly on all Windows versions (few days ago it was Windows 7).

@miniksa Is there a way to bypass the problem? Why input is dropped? How may ConEmu deal with conhost on legacy but still supported Windows versions like Win7?

@Maximus5 Just in case it's useful info, I'm experiencing this issue in ConEmu (and Cmder), but not if I open a Bash on Ubuntu on Windows shell directly (or use, eg. Hyper terminal). I wonder if that suggests that there might actually be a ConEmu (rather than MS) issue here? (Sorry if I'm wrong: I don't know anything about conhost or how it works)

How do you run Bash? Via task? What is there?

I'm using the Windows Subsystem for Linux: an Ubuntu / Bash shell built into Windows which allows you to run Linux tools natively. Once it's installed, you can run "bash" in Windows and it opens this shell (or you can find "Bash on Ubuntu on Windows" in the start menu).

Usually I run this inside Cmder, and it used to work fine. However, late last year pasting stopped working. Cmder have an open issue about this that is marked as being a problem with ConEmu, and that seems to be the case (I tried running ConEmu on its own, and also ran into this issue).

Hope that helps! Let me know if there's anything else I can tell you.

What @nickautomatic describe is very much what I experience too. It seems to be the same problem we are facing.

I believe this is a bug in bash and it must be fixed by Microsoft team working on WSL.

If you use connector, the problem is gone.
BashOnWindows in ConEmu

@deadalnix looks like it relates to #1314 (see this comment), use latest alpha build and ensure your task command looks like the one in the link @Maximus5 gave above; running bash.exe I think will still give you the problem, so you have to do it the way that link describes.

Is there a solve for this? Do I really have to install this "connector" as per instructions here and here? That seems like a lot of extra dependencies and things I don't understand just to get copy paste working normally. I too am getting characters dropped if I try to paste anything more than a single uninterrupted string (spaces and slashes seems to start getting pruned randomly).

Help or alternatives would be greatly appreciated.

EDIT: Never mind! I don't know what part of what I did fixed this exactly but I updated to the ConEmu Alpha (180318), updated my tasks, and then reset my startup task to bash after trying git:bash for a bit. I think the task reset/update did it! Thanks.

@BenChirlin Sounds like you've fixed it, but for the record I've also had no problem with pasting lately, and I think it might also have been updating to the preview version that fixed it (in Cmder's settings: Main --> Update --> Preferred release type --> Preview)

I've updated to the latest preview as well as performing the steps in here

This now allows me to paste correctly!

I had this issue on ConEmu 161206 [64] Stable which was solved by using ConEmu 180528
I do not have the issue if I do "Debug > Real Console".

Although before I never had problems with pasting into ConEmu bash commandline, this suddenly did not work correctly anymore as only a part of the clipboard was pasted: when pasting a string with double quotes in it, only the part between double quotes was pasted (including the double quotes).

Updating from version 161206 to version 180528 solved the problem for me.

It's not only ConEmu, Windows internals has changes too and you have to use latest builds to have new patches

The problem still exists. I use

Microsoft Windows [Version 10.0.17134.112]
Linux DESKTOP-8LIHMRG 4.4.0-17134-Microsoft #112-Microsoft Thu Jun 07 22:57:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial



md5-2fd37729d70182ce90b96b4279cdb6a7



ConEmu 180318 [32] {Alpha}

@jonyrock The problem does not exist.
Man, you are using old build of ConEmu.

fwiw I had this issue (I was running the stable build), updated to the latest preview release (180626), and can confirm pasting is working as expected.

Thanks so much for your continued efforts, @Maximus5 -- ConEmu makes using Windows bearable!

I found a solution changing in Settings > Keys & Macro > Paste all paste mode to Multi lines

pasting in conemu works with shift + insert, but copying still doesn't work for me

Problem appearing again on 191012 Preview :(

The problem still exists in the latest preview build (using bash as the shell). My workaround is to open bash from PowerShell or CMD, then paste works normally.

I solved this by setting my bash:bash task to only this "C:Program FilesWindowsAppsCanonicalGroupLimited.Ubuntu20.04onWindows_2004.2020.424.0_x64__79rhkp1fndgscUbuntu2004.exe"

Look for Ubuntu2004.exe and have conemu run that, everything works because canonical made it.

Edit: turns out the issue is still happening but mildly.

So I installed wsltty which has wsl-bridge2.exe and wsl_backend2.exe, it generated a terminal shortcut in %LOCALAPPDATA% which I copied into a custom shell.

Copy and paste works perfectly because it utilizes the wsl2 bridge.

Here is my task from start to finish quotes are for clarity not literal:
"C:UsersmeAppDataLocalwslttybinmintty.exe --WSL="Ubuntu-20.04" --configdir="C:UsersmeAppDataRoamingwsltty" -~ -"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pyhedgehog picture pyhedgehog  路  3Comments

jrcharney picture jrcharney  路  5Comments

dandv picture dandv  路  3Comments

imalos picture imalos  路  5Comments

MandarSant picture MandarSant  路  3Comments