More accurately, your shell (bash, by default) preserves the command history. It's not a function of the terminal app, gnu screen, or byobu. They all run bash, so they all share a bash history.
I don't see the behavior you're describing. My sudo shutdown ... commands seem to be preserved fine.
Some reasons you might not see a command in your bash history -
- when you enter a command with spaces at the very beginning of the line, it's not kept in the history (assuming your $HISTCONTROL contains "ignorespace" or "ignoreboth")
- the HISTIGNORE variable defines patterns to be excluded from the history. A cautious admin might add 'shutdown' as a string to exclude, to avoid accidentally shutting down a system with a mistaken history invocation.
- The history is written to disk (~/.bash_history) when the shell exits. If the shell is ended abnormally (e.g. segfault, power loss, etc) then your history for that session won't be saved. (During shutdown the shell is typically killed normally and writes its history.)
More details can be found here: Bash Reference Manual: Bash History Facilities