Comments (4)
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.
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.
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.
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)
- Charts ideas HOT 2
- Improve display for sync data errors
- Add install script
- Type should be computed before command HOT 1
- Improve type getter HOT 2
- Handle using history on multiple hosts HOT 1
- Use dichotomy instead of "one by one" when db commit fails HOT 1
- Follow the history file in real-time
- Split the code in multiple modules
- Cannot find bash history HOT 9
- event not found: -0 HOT 4
- SQLite objects created in a thread can only be used in that same thread HOT 4
- Stop using SHELL variable
- Make sure SHLVL is working as expected
- Use CSV formatting instead of custom colon-separated + base64 encoded
- Unable to install with pip or pipx HOT 9
- Use PS0 instead of a trap on DEBUG?
- Trap on DEBUG not removed with shellhistory disable
- Use flask-sqlalchemy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shell-history.