I have noticed that using zsh the history
command is not available when executed from Emacs via shell-command
.
history | grep runserver
results in zsh:fc:1: no such event: 1
.
I also use the histdb
command from https://github.com/larkery/zsh-histdb and although the command is available from zsh it can't be called from the Emacs.
histdb --limit 2000 | grep runserver
outputs zsh:1: command not found: histdb
Obviously there is core aspect of shells I don't understand.
What is needed to fix these?
This phenomenon does not exist solely in Emacs. When I run a remote ssh command eg ssh admin@example.com 'histdb --limit 2000'
the same error message appears..
env
) and look for theSHELL
variable in there. Another possibility (I'm not familiar with zsh either) is that history is only enabled for interactive sessions (otherwise every time you run a script, all the commands in the script would be registered in the history.) – cryptarch Jan 14 '23 at 02:27