This question already has an answer here:
I connect to a screen session. After doing some stuff I detach it. Then in
history | tail I only see
screen -r and previous commands and not the commands run in screen session. Basically history shows different things when screen session is running and after it is detached.
How do I make sure that the commands in screen session are appended to
Config: screen 4.0.3, bash 4.1.2