add shell compatibility patch from #2659