cmdEx icon indicating copy to clipboard operation
cmdEx copied to clipboard

Merging cmdEx into Cmder/Clink

Open DRSDavidSoft opened this issue 6 years ago • 3 comments

This feature of getting rid of Ctrl+C→Y on cmdEx is quite handy. Since someone at cmderdev/cmder/issues/1666 asked for it, and Clink is forked (the author's been disappeared), I was wondering if it's possible to either run cmdEx alongside Clink (within Cmder), or to merge cmdEx functionality with the Clink's fork.

What do you suggest is the better way to implement cmdEx's functionalities for Cmder?

DRSDavidSoft avatar Feb 23 '18 15:02 DRSDavidSoft

I suspect Clink and cmdEx wouldn't work well together as they're both futzing around inside cmd in similar ways, so their patches are unlikely to work together.

The other problem is that the Ctrl-C functionality isn't quite baked in cmdEx unfortunately. The part in the readme about adding to "HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun" is necessary to make the Ctrl-C suppression work properly everywhere, but the startup time of cmdEx is way too slow for that.

I had some ideas to make injection much faster so that could be done, but nothing not implemented yet. (I also don't develop on a Windows box too often right now either, so I'm not likely to get to that any time soon.)

sgraham avatar Feb 23 '18 16:02 sgraham

I understand that, though I don't know how cmdEx works to suppress Ctrl-C. What is the main cause of it being slow? Could you give a summary of what do you have in mind to make it faster?

Also, would it make sense to rewrite it as a ConEmu interface (Maximus5/ConEmu/issues/270)?

If I could do it, I'm eager to modify both cmdEx and Clink to make this functionality as smooth as possible :)

DRSDavidSoft avatar Feb 23 '18 16:02 DRSDavidSoft

The Ctrl-C patch is here: https://github.com/sgraham/cmdEx/blob/master/src/cmdEx_dll_x86_dll/dll.cc#L1010

It's been a while, but I think the startup time was mostly dominated by unpacking resources (I bundled everything into one .exe for simple distribution) and then symbol acquisition. I vaguely planned to cache some of that, but really it'd just need profiling and elbow grease.

I think if you just want to get Ctrl-C prompt suppression, I'd probably instead try to make a minimal version of that patching code standalone instead, and put just that .exe into cmd's AutoRun.

I never switched to ConEmu, so I don't have a horse in that race, still on an old Console2. :/

sgraham avatar Feb 24 '18 06:02 sgraham