So you want the history of of all commands, regardless of where they are executed? I don't know if emacs provides this by default, but you can add your own function to post-command-hook
which is executed after every command, so you can use it to collect all the executed commands.