Comments (8)
Cool, but maybe it is decided by the shell?
from thefuck.
To avoid adding the fuck
commands to history, you can use the following in Bash:
export HISTIGNORE=' *'
Then any command prefixed with a space will not be added to history. So instead of typing fuck
, you would need to type fuck
(with a space as the first character), and it will not be added to the shell's history.
from thefuck.
I use zsh, and It seems that the HISTIGNORE trick it's not working. (but It's not so important I've already set to not save duplicates).
I think thefuck could execute "history" command to update the history. I've not tested it but man says:
history change newValue ?event?
Replaces the value recorded for an event with newValue. Event
specifies the event to replace, and defaults to the current event
(not event -1). This command is intended for use in commands that
implement new forms of history substitution and wish to replace the
current event (which invokes the substitution) with the command
created through substitution.
is it cross-shell compatible? :\
from thefuck.
I was just about to suggest this. 👍
Avoiding adding fuck
commands can at least be configured per shell, whereas adding the modified commands cannot. Ideally the original command would also be left intact (in case thefuck was wrong). Removing the fuck
command from within thefuck
could be difficult without some hack.
While fc
can work differently in different shells, the example below works great in bash
- removing the fc
command from history while keeping the original and modified commands in the history. In zsh
the example works the same, except the fc
command remains in history.
$ ls -l /usr
$ fc -e- /usr=/etc
History in bash
afterward:
ls -l /usr
ls -l /etc
from thefuck.
Implemented for zsh and bash in 1.35+
from thefuck.
Awesome, @nvbn! Thanks! As soon as I have some spare time I can dig this one and implement it for Fish.
from thefuck.
The solution to this issue Fish-wise depends on fish-shell/fish-shell#825 available in the upcoming release, [Fish 2.2.0](/fish-shell/fish-shell/milestones/fish 2.2.0). I'll keep an eye on that and update the fuck
Fish function as soon as that's released.
from thefuck.
So now it works.
from thefuck.
Related Issues (20)
- Instant mode crashes KDE Plasma on login HOT 1
- Command intercepted but not presented a fuck, have to run fuck manually for the suggestion
- Command takes 6 seconds, then doesn't find the correction HOT 1
- Install error HOT 4
- no fucks given for git no tracking information for the current branch HOT 4
- Fetch sqlite fails when install with macos HOT 2
- [WARN] Output log isn't specified when "instant mode" turned on
- `<editor> <bash-path> +1 && puthon` suggestion instead of `python` HOT 4
- OpenSSL 1.1 End of Life HOT 4
- subprocess.run does not work inside side_effect
- ModuleNotFoundError: No module named 'imp' (python 3.12.0) HOT 3
- Not fully compatible with python 3.12.0 yet. HOT 1
- [Suggestion] Correct pip remove, delete to uninstall
- How about adding a typo correction rule related to 'nvm'?
- Request for adding Pull Request Template
- I can't run thefuck on powershell HOT 1
- Unhandled `apt` "Packages were downgraded and -y was used without --allow-downgrades" error
- Support for Windows CMD HOT 4
- /.zshrc:1: command not found: thefuck HOT 3
- Shell slow to start with `eval "$(thefuck --alias)"`, workaround is a lazy loading trick HOT 1
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 thefuck.