Fixed clear functionality in shell mode