diff --git a/troubleshooting.md b/troubleshooting.md index dbefff7..75b4b69 100644 --- a/troubleshooting.md +++ b/troubleshooting.md @@ -22,13 +22,32 @@ resh-daemon-stop :warning: You will get error messages in your shell when RESH daemon is not running. +## Recorded history + +Your RESH history is saved in one of: +- `~/.local/share/resh/history.reshjson` +- `${XDG_DATA_HOME/resh/history.reshjson` + +The format is JSON prefixed by version. Display it as json using: + +```sh +cat ~/.local/share/resh/history.reshjson | sed 's/^v[^{]*{/{/' | jq . +``` + +You will need `jq` installed. + ## Logs +Logs can be useful for troubleshooting issues. +Find RESH logs in one of: +- `~/.local/share//resh/log.json` +- `${XDG_DATA_HOME}/resh/log.json` ## Disabling RESH -If you have a persistent issue with RESH you can temporarily disable it. +If you have a persistent issue with RESH you can temporarily disable it and then enable it later. +You won't lose your history nor configuration. Go to `~/.zshrc` and `~/.bashrc` and comment out following lines: ```sh @@ -37,9 +56,14 @@ Go to `~/.zshrc` and `~/.bashrc` and comment out following lines: ``` The second line is bash-specific so you won't find it in `~/.zshrc` +You can re-enable RESH by uncommenting the lines above or by re-installing it. + +## Common issues -### RESH in bash on macOS doesn't work +### Using RESH in bash on macOS -**A:** Add line `[ -f ~/.bashrc ] && . ~/.bashrc` to your `~/.bash_profile`. +MacOS comes with really old bash (`bash 3.2`). +Update it using: `brew install bash` -**Long Answer:** Under macOS bash shell only loads `~/.bash_profile` because every shell runs as login shell. +On macOS, bash shell does not load `~/.bashrc` because every shell runs as login shell. +Run `echo '[ -f ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile`