(Hack) to make shell able to quit if the mainloop finishes.