move the cd from cli to set operation to avoid subprocess, fix #2433