When mongo client(mongo shell) is running within linux shell,
if linux shell is killed or terminated (sigterm), mongo client run buffered command(input command but not yet executed by ENTER/RETURN keyboard) before terminated.
I don't know this is mongo shell issue or linux terminal.
But this issue is not happened another CLI client(like mysql client in same scenario).
This is relatively critical issue what command user typed on mongo client shell.