Two kinds of bash histories: Session history (in RAM) and stored history (in file zsh_history, bash_history, etc.) Good reference
Managed to inject the command into shell history file (unix only for now), but the problem is that it still doesn't show up in the session history. To do that we need to copy the file into session history with history -r; which is a no-go.
A way to inject into session history directly is print -s *command* (zsh) or history -s *command* (bash). But this doesn't work when done from inside pet. Perhaps it's a subshell issue where the history is different from the parent shell that ran pet.
Need a way to manipulate parent shell from subshell.
After spending an hour on this, seems pretty hard to do @sgohl
Looking into this a little:
Two kinds of bash histories: Session history (in RAM) and stored history (in file zsh_history, bash_history, etc.) Good reference
Managed to inject the command into shell history file (unix only for now), but the problem is that it still doesn't show up in the session history. To do that we need to copy the file into session history with
history -r;
which is a no-go.A way to inject into session history directly is
print -s *command*
(zsh) orhistory -s *command*
(bash). But this doesn't work when done from inside pet. Perhaps it's a subshell issue where the history is different from the parent shell that ran pet.Need a way to manipulate parent shell from subshell.
After spending an hour on this, seems pretty hard to do @sgohl