Try using get_cwd() for shell errors
shell: fix detecting curdir for more complex setups