Scoop, although very useful and nice to use,
uses a (subjectively) terrible shim.exe
file to redirect commands from scoop\shims\app.exe to scoop\apps\app\current\app.exe, because:
- It's made in C#, and thus requires an instantiation of a .NET command line app everytime it is started, which can make a command run much slower than if it had been ran directly;
- It does not handle Ctrl+C and other signals correctly, which can be quite infuriating.
The last issue making interaction with REPLs and long-running apps practically impossible, and having never been fixed, I set out to improve them with this repository.
shim.cpp is:
- Faster, because it does not use the .NET Framework, and parses the
.shimfile in a simpler way. - More efficient, because by the time the target of the shim is started, all allocated memory will have been freed.
- And more importantly, it works better:
- Signals originating from pressing
Ctrl+Care ignored, and therefore handled directly by the spawned child. Your processes and REPLs will no longer close when pressingCtrl+C. - Children are automatically killed when the shim process is killed. No more orphaned processes and weird behaviors.
- Signals originating from pressing
Note: This project is not affiliated with Scoop.
-
Building:
- Build by
clang++:Makefileis supported - Build by using
ninja:ninja -C build shim.exe - Build by using
msbuild:msbuild /p:Configuration=Release .\build\shim.vcxproj
- Build by
-
Replace any
.exeinscoop\shimsbyshim.exe.
An additional script, repshims.bat, is provided. It will replace all .exes in the user's Scoop directory
by shim.exe.
SPDX-License-Identifier: MIT OR Unlicense