ferd / erlang-history

Hacks to add shell history to Erlang's shell
494 stars 30 forks source link

cannot persist previous closed shell history #26

Closed TangMonk closed 7 years ago

TangMonk commented 7 years ago

If I open a erl shell and type some thing, then close it and reopen a new shell, then will lose previous shell history

ferd commented 7 years ago

There is a possibility for this to happen if line writes have been done and the VM shut down before the data could be synchronized to disk, but right now your bug report is so vague I must also ask if erlang-history is even installed on the Erlang version you run?

You can verify by calling group_history:module_info() and seeing if data loads. You should also have to check whether you're loading old-style shell or new-style shell.

Unfortunately, without such information, it's very hard to figure out what the issue might be.

TangMonk commented 7 years ago

I installed Erlang R18 before, When I reinstall Erlang R19, it occurs this problem. And I am reinstall this project again, but same problem.

when I type group_history:module_info() in shell, it told me undefined function group_history:module_info/0.

ferd commented 7 years ago

That means that this library is not installed or not loaded with your release. The group_history module is the one doing the actual work. If the module is not loaded at run-time, it means the erlang-history library is not properly installed.

If you could offer the output of:

$ erl
[taglines here]
1> rp(application:which_applications())

it would help. Alternatively, try fetching an updated version of this library and installing again.

TangMonk commented 7 years ago

thanks for you reply

1> rp(application:which_applications()).
[{stdlib,"ERTS  CXC 138 10","3.1"},
 {kernel,"ERTS  CXC 138 10","5.1"}]
TangMonk commented 7 years ago

thanks, I am reinstall with sudo make install, it works again!, thanks!

TangMonk commented 7 years ago

and I am notice you are the author of the I am reading "learn you some erlang for great good" book, thanks for your work!

ferd commented 7 years ago

No problem! Glad things are working out for you.