一个可以快速纠正上次控制台命令的神奇指令
The Fuck 是一个可以快速纠正上次控制台命令的神奇指令
例如
➜ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
➜ fuck
git push --set-upstream origin master [enter/↑/↓/ctrl+c]
Counting objects: 9, done.
...
➜ git brnch
git: 'brnch' is not a git command. See 'git --help'.
Did you mean this?
branch
➜ fuck
git branch [enter/↑/↓/ctrl+c]
* master
Star
常见问题
c:\python3\lib\site-packages\win_unicode_console\__init__.py:31: RuntimeWarning: sys.stdin.encoding == 'utf-8', whereas sys.stdout.encoding == 'ascii', readline hook consumer may assume they are the same
readline_hook.enable(use_pyreadline=use_pyreadline)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 6: invalid start byte
- 添加全局环境变量
PYTHONIOENCODING=utf-8
- 在
$PROFILE
中添加[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb2 in position 6: invalid start byte