Git Product home page Git Product logo

Comments (4)

pawamoy avatar pawamoy commented on May 22, 2024 1

Not at all! But provided Powershell has ways of executing code before and after each interactive command, and disposes of a history which can be queried, it shouldn't be too hard to add support for it!

The shell code is only around 200 lines of code 🙂

I'm gonna see what Powershell has to offer (or if you already have some knowledge about it, don't hesitate to share here!)

from shell-history.

pawamoy avatar pawamoy commented on May 22, 2024

Question on StackOverflow: https://stackoverflow.com/questions/55972059/powershell-execute-things-before-and-or-after-an-interactive-command

  • before
  • after: using prompt function

I don't know Powershell at all so if anyone could look into the suggestions made in the comments it would be great!

from shell-history.

kiedtl avatar kiedtl commented on May 22, 2024

I'm not sure about the internals of shellhistory, but wouldn't it be possible to do with only an after function? Or would some features be broken?

from shell-history.

pawamoy avatar pawamoy commented on May 22, 2024

It would not be broken, but the generated data could be inaccurate. If a command changes the working directory, or overrides itself or deletes itself (think of virtualenvs' deactivate function: it unsets itself at the end), then we could not compute its true type (file/function/alias etc).

We also need to get a timestamp before the command, to be able to compute its duration. That's actually the main reason for executing code before commands.

That said, maybe there are clever ways to do that in Powershell! Since it's a completely different shell, Bash/Zsh logic might not apply.

from shell-history.

Related Issues (20)

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.