rsalmei / zsh-history-to-fish Goto Github PK
View Code? Open in Web Editor NEWBring your ZSH history to Fish shell.
License: MIT License
Bring your ZSH history to Fish shell.
License: MIT License
When I run it it just hangs forever:
$ zsh-history-to-fish -dn
ZSH history to Fish
===================
input : /home/ddrucker/.zsh_history (naive-convert=False)
output: dry run mode
and that's it, just hangs forever.
Hello,
Do you have recommendations for importing history from a ~/.bash_history file?
In my .zsh_history file I have 3302 lines, why does the script find only 30?
cat .zsh_history | wc -l 3302
input : /home/riccardo/.zsh_history (naive-convert=False)
output: dry run mode
.
Processed 30 commands.
No file has been written.`
┬─[yifei@bogon:~]─[14:10:51]
╰─>$ zsh-history-to-fish -n
ZSH history to Fish
===================
input : /Users/yifei/.zsh_history (naive-convert=False)
output: /Users/yifei/.local/share/fish/fish_history
.
Processed 1000 commands.
File "/Users/yifei/.local/share/fish/fish_history" has been written successfully.
┬─[yifei@bogon:~]─[14:11:08]
╰─>$ history | wc -l
289
I can see the commands are already in ~/.local/share/fish/fish_history
, but fish seems to ignore them.
https://github.com/rsalmei/zsh-history-to-fish/blob/main/zsh_history_to_fish/command.py#L24 replaces \n
with actual newlines, but fish
expects two characters to be \
-escaped: newlines and \
. So
\n
when it shouldn't\
to \\
, but it doesn'tAmazing, thanks!! 🤩
I know you have put a lot of love into this @rsalmei . So I gave this tool a shot and got this error:
Traceback (most recent call last):
File "/usr/local/bin/zsh-history-to-fish", line 8, in <module>
sys.exit(exporter())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/zsh_history_to_fish/command.py", line 72, in exporter
for timestamp, command_zsh in parse_history(input_file):
ValueError: not enough values to unpack (expected 2, got 1)
Any ideas?
Traceback (most recent call last):
File "/home/ilya/zsh-history-to-fish/virtualenv/bin/zsh-history-to-fish", line 10, in <module>
sys.exit(exporter())
File "/home/ilya/zsh-history-to-fish/virtualenv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/ilya/zsh-history-to-fish/virtualenv/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/ilya/zsh-history-to-fish/virtualenv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ilya/zsh-history-to-fish/virtualenv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/ilya/zsh-history-to-fish/virtualenv/lib/python3.7/site-packages/zsh_history_to_fish/command.py", line 68, in exporter
for line in history(input):
File "/home/ilya/zsh-history-to-fish/virtualenv/lib/python3.7/site-packages/zsh_history_to_fish/command.py", line 17, in history
line = line.replace(b'\xe2\x80\x83\xb4', b'-').decode('utf-8').strip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 27: invalid start byte
If HISTSIZE
is unset in your .zshrc
, zsh-history-to-fish only processes 1000 lines of history. Set it to a large number instead to get your whole file.
I consider this a bug - the expection is that this program should process your entire history file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.