pawamoy / shell-history

Visualize your shell usage with Highcharts!
ISC License
112 stars 2 forks source link

Cannot find bash history #18

Closed sontqq closed 1 month ago

sontqq commented 6 years ago

As the title says it cannot find the history.

Failed to import current history. The following exception occured: <class 'ValueError'>: /root/.shell_history/history: no such file

I am running Raspbian GNU/Linux 9 (stretch)

Any idea how to solve it?

pawamoy commented 6 years ago

Woohoo first issue :tada: ! Thanks for your interest :smile: !

A few questions:

To check if shell history is enabled, simply enter set -x in your shell. You should see all the instructions run by shell history. Deactivate this mode with set +x.

All this is a bit wonky, sorry :confused: I plan on improving installation process and robustness.

sontqq commented 6 years ago

I am using bash, and inserted . '/home/pi/git/shell-history/shellhistory.sh' into /root/.bashrc.

ls: cannot access '/root/.shell_history/history': No such file or directory

/root/.shell_history/db --> exists

-rw------- 1 root root 18K Oct 12 21:48 /root/.bash_history --> exists

root@sont:~# set -x
root@sont:~# set +x
+ set +x
root@sont:~# set -x

This is everything i found. I found your project really awesome. I love visualization! 😆

pawamoy commented 6 years ago

Ah, maybe you just forgot to add shellhistory enable after . '/home/pi/git/shell-history/shellhistory.sh' in .bashrc?

I found your project really awesome. I love visualization!

Thanks a lot! Yeah I love visualization too, transforming some raw data in useful/meaningful graphics is great :grin:

sontqq commented 6 years ago

Nope, I've added it. :(

pawamoy commented 6 years ago

Sorry for the delay.

Here is how I use shell-history myself:

shopt -s histappend

export HISTSIZE=-1

. "/path/to/shellhistory/shellhistory.sh"
shellhistory enable

Could you try to set histappend and HISTSIZE like above?

pawamoy commented 6 years ago

Also, what version of Bash do you have? bash --version

sontqq commented 6 years ago

Still no result 😞

GNU bash, version 4.4.12(1)-release (arm-unknown-linux-gnueabihf)

pawamoy commented 5 years ago

Hi @sontqq!

I just packaged the application using Poetry, and pushed a release to PyPI. Instructions are available in the README, and also in the CHANGELOG.

Could you try again with the new version?

The default directory is now ~/.shellhistory instead of ~/.shell_history. If you don't have a history file yet, you can simply delete the old database and directory, as the new one will be automatically created.

On my side I will try to see if I can launch a Raspbian docker container to see if it works.

pawamoy commented 5 years ago

Just finished testing on a Raspbian VM, it seems to work fine.

pawamoy commented 1 month ago

No updates, closing :slightly_smiling_face: