jcsalterego / historian Goto Github PK
View Code? Open in Web Editor NEWCommand-line utility for managing shell history in a SQLite database.
License: Other
Command-line utility for managing shell history in a SQLite database.
License: Other
hi @jcsalterego nice script you have here, I would like to suggest this :
please assign this issue to me, I will PR later
Hi there,
do you have any idea why historian doesn't work with fzf ?
After installing fzf i simply changed history
to hist /
in https://github.com/junegunn/fzf/blob/master/shell/key-bindings.bash#L58
and this works when searching in the history by pressing CTRL+R in the terminal. But when selecting one of the items in the list, that item doesn't get output/pasted back to the terminal.
I noticed that the output format of historian is different from the default 'history', so perhaps that is the issue?
If so, it would be cool if the output format would be equal to history, for better compatibility with other tools.
Thank you!
$ history | grep -i 'test 123'
520 echo "test 123"
$
$ hist /'test 123'
1923
echo "test 123"
$
Support for zsh would be a very welcome addition ;)
I use zsh. It's fairly simple to support this by making the SRC var settable. Can this be done? If so how would you suggest it, if I were to try do that myself as a PR?
Hi,
This looks great. Is it something that could be added to Homebrews repos?
Thanks.
Testing this on linux in the hope that historian will be able maintain the command history intelligently across multiple terminals in bash (depends on #9).
However, at the moment I'm seeing a more fundamental problem - imported commands truncated to 23 characters?
Nice project!
Fish's history includes a little more information than just the command that was executed. ~/.local/share/fish/fish_history
is a yaml file, here's a sample:
- cmd: v /usr/local/etc/rethinkdb.conf
when: 1492027898
paths:
- /usr/local/etc/rethinkdb.conf
As you can see it includes the command, a timestamp, and the filepaths references by the command.
Quick question: please, why you are not using sqlite3 in none interactive mode like this:
#!/bin/bash
sqlite3 test.db "create table n (id INTEGER PRIMARY KEY,f TEXT,l TEXT);"
Have you seen this before?
[user@centos7 ~]$ cat .bash_history
echo `whoami`
[user@centos7 ~]$ local/libexec/hist import
Error: /home/user/.bash_history line 1: expected 1 columns of data but found 3
Imported 0 item(s).
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18093: unescaped " character
/Users/zivago/.bash_history:18088: unterminated "-quoted field
Imported 1 item(s).
this is on historian v0.0.2. Looks like some of the items in bash history was a bad command line option. Anyway to escape them properly so it imports it?
Hello,
when I try to import my history with some lines containing the '"' character it will fail with :
/home/bob/.bash_history:156: unescaped " character
/home/bob/.bash_history:156: unescaped " character
/home/bob/.bash_history:506: unescaped " character
Concerned lines example :
ssh-keygen -f "/home/bob/.ssh/known_hosts" -R
A single quote "
triggers an error
/Users/maxm/.bash_history:3436: unescaped " character
/Users/maxm/.bash_history:3889: unterminated "-quoted field
Seems to depend somewhat on the presence of surrounding quote characters in the bash history
To reproduce, a .bash_history file containing only:
"
hist import
triggers this error
$ hist count
183
$ ls /some/new/path
...
$ hist count
184
It would be nice to insert items in the database immediately. This is particularly useful when you have two terminals open.
Hi Jerry, you have a wonderful project here. Thank you for sharing the code. I would like to help and participate ....
Could you please set an initial board to suggest fix and add features ?
Regards,
Got these errors on import:
/Users/user/.bash_history:484: expected 1 columns but found 3 - extras ignored
This line has:
i2cssh -2 -A -l user for i in $(seq -f %02g 1 8); do echo -n "server$i-use1 " ; done
I'm guessing it is having issues on the quotes or backticks.
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.