fixes tos sudden exit when entering 'Y' in cli

Fixes #851
Fixes #853
Fixes #854
Fixes #862
Fixes #871