Coder Social home page Coder Social logo

scoop-better-shimexe's Introduction

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:

  1. 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;
  2. 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 .shim file 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+C are ignored, and therefore handled directly by the spawned child. Your processes and REPLs will no longer close when pressing Ctrl+C.
    • Children are automatically killed when the shim process is killed. No more orphaned processes and weird behaviors.

Note: This project is not affiliated with Scoop.

Installation

  • In a Visual Studio command prompt, run cl /O1 shim.c.
  • Or using clang++ with clang++ shim.cpp -o shim.exe -m32 -O -std=c++17 -g.
  • Replace any .exe in scoop\shims by shim.exe.

An additional script, repshims.bat, is provided. It will replace all .exes in the user's Scoop directory by shim.exe.

License

SPDX-License-Identifier: MIT OR Unlicense

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.