-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to save any output automatically in bash #6
Comments
With ZSH it is rather simple: function execute_with_ah {
BUFFER="ah t -yx -- $BUFFER"
zle accept-line
}
zle -N execute_with_ah_widget execute_with_ah
bindkey '^J' execute_with_ah_widget
bindkey '^M' execute_with_ah_widget But since Bash has no real |
Maybe it makes sense to send a feature request to bash developers. ;-) |
After bit of tests I came to the solution (mostly zsh) which is HORRIBLE shell script which does a lot of stuff to make auto execution actually work. This script is unmaintainable and basically I am scary about idea to support it. The reason is that some commands must be avoided by ah: So I've decided to go by white lists. I'll add 3 new subcommands:
This is perfectly safe and covers mostly all real world cases. But user has to avoid those |
This is a bit tricky. The program is probably created to make the life more easy, but not for adding new problems. What about sending a feature request to bash developers? Also I'd say that plain config file is more easy way to manage the program behaviour. The command that many users know already is |
No, this is not about bash, this is about shells. I meet this problem with Zsh and Fish (#9) (Fish is even worse, I gonna reject to support it, no way to inject ah into his loop) Those problems are exist because ah is not a part of any shell. It is hard to interfere into the shell to understand aliases, one-liners like My proposal is to have some kind of whitelisting of commands: by default, ah will ignore execution but if command was added, it will work. Actually, it is already on master. Let's check my whitelist: ➜ ah al
ag [interactive=false, pseudoTty=false]
find [interactive=false, pseudoTty=false]
grep [interactive=false, pseudoTty=false]
ll [interactive=true , pseudoTty=false]
ls [interactive=false, pseudoTty=false]
python [interactive=false, pseudoTty=false]
ssh [interactive=false, pseudoTty=false]
➜ python some_script.py it is converted to ➜ ah t -- python some_script.py And I agree with you on configs, but basically it is too long to add new command to the list with proper options. You type |
Ok, I see. Thanks for the explanation. This still seems too complicated. I'd have to add each command to the white list. Maybe it makes sense to add some tiny layer between the terminal (emulator) and the shell? |
Will you please elaborate? |
Well, I'm not sure how to implement this, but the idea is to create a tiny terminal emulator that should be run inside of another terminal. Something like |
It would be useful to have all outputs saved automatically without prepending commands with
ah t --
The text was updated successfully, but these errors were encountered: