Fixes #3883 - persistent history in shell