In bash you can bind a key to a command and so, for example, list the
command history whilst in the middle of typing a new command.
After the command runs your input line is restored at the point you
were originally at.
Eg, give the command
bind -x '"\C-a": history'
Then controla will dump the history.
For permanence add to your ~/.inputc file
"\C-a": history
You can replace history by any command.
In zsh you have a built-in mechanism which pushes the current input buffer
onto a stack and allows you to give a new command. When it finishes, the
previous input buffer is restored. So you type: escapeq
history return.
If you prefer you can setup a zsh widget binding to show the history below the current input buffer you are typing. Eg, for controla again (in your ~/.zshrc):
zle -N myhistory
myhistory(){zle -M "$(history)";}
bindkey '^a' myhistory
To keep output history you might like to use screen -L which keeps a log
of all the output in a file, which you can tail with a binding as above. You might want to filter through cat -e or something, as the file includes
all terminal escape sequences.