{"action":"created","issue":{"url":"https://api.github.com/repos/matthias-t/workspace/issues/10","repository_url":"https://api.github.com/repos/matthias-t/workspace","labels_url":"https://api.github.com/repos/matthias-t/workspace/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/matthias-t/workspace/issues/10/comments","events_url":"https://api.github.com/repos/matthias-t/workspace/issues/10/events","html_url":"https://github.com/matthias-t/workspace/issues/10","id":335078062,"node_id":"MDU6SXNzdWUzMzUwNzgwNjI=","number":10,"title":"It's impossible to change the working directory from Rust","user":{"login":"matthias-t","id":26206173,"node_id":"MDQ6VXNlcjI2MjA2MTcz","avatar_url":"https://avatars2.githubusercontent.com/u/26206173?v=4","gravatar_id":"","url":"https://api.github.com/users/matthias-t","html_url":"https://github.com/matthias-t","followers_url":"https://api.github.com/users/matthias-t/followers","following_url":"https://api.github.com/users/matthias-t/following{/other_user}","gists_url":"https://api.github.com/users/matthias-t/gists{/gist_id}","starred_url":"https://api.github.com/users/matthias-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthias-t/subscriptions","organizations_url":"https://api.github.com/users/matthias-t/orgs","repos_url":"https://api.github.com/users/matthias-t/repos","events_url":"https://api.github.com/users/matthias-t/events{/privacy}","received_events_url":"https://api.github.com/users/matthias-t/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-23T07:36:33Z","updated_at":"2018-06-23T20:36:15Z","closed_at":null,"author_association":"OWNER","body":"See [this question](https://stackoverflow.com/questions/43361154/how-to-change-os-to-directory-using-rust) on stackoverflow. It's also impossible to run commands that directly affect the user's current open shell. Using `std::process::Command` will spawn a new process, and changing the directory will only affect that new process.\r\n\r\n### Now what?\r\n\r\nThe idea is to create shell functions that wrap workspace. They read the output, pick out lines that start with, say, `!`, and execute those, then print the rest. We could take inspiration from [gsamokovarov/jump](https://github.com/gsamokovarov/jump), they seem to follow a similar approach (see their shell folder)."},"comment":{"url":"https://api.github.com/repos/matthias-t/workspace/issues/comments/399709185","html_url":"https://github.com/matthias-t/workspace/issues/10#issuecomment-399709185","issue_url":"https://api.github.com/repos/matthias-t/workspace/issues/10","id":399709185,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTcwOTE4NQ==","user":{"login":"matthias-t","id":26206173,"node_id":"MDQ6VXNlcjI2MjA2MTcz","avatar_url":"https://avatars2.githubusercontent.com/u/26206173?v=4","gravatar_id":"","url":"https://api.github.com/users/matthias-t","html_url":"https://github.com/matthias-t","followers_url":"https://api.github.com/users/matthias-t/followers","following_url":"https://api.github.com/users/matthias-t/following{/other_user}","gists_url":"https://api.github.com/users/matthias-t/gists{/gist_id}","starred_url":"https://api.github.com/users/matthias-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthias-t/subscriptions","organizations_url":"https://api.github.com/users/matthias-t/orgs","repos_url":"https://api.github.com/users/matthias-t/repos","events_url":"https://api.github.com/users/matthias-t/events{/privacy}","received_events_url":"https://api.github.com/users/matthias-t/received_events","type":"User","site_admin":false},"created_at":"2018-06-23T20:36:15Z","updated_at":"2018-06-23T20:36:15Z","author_association":"OWNER","body":"Hours of trial and error on my Ubuntu WSL led to this:\r\n```bash\r\nfunction ws {\r\n    while read -r; do \r\n        if [[ \"$REPLY\" == \\!* ]]; then \r\n            source <(echo \"${REPLY:1}\"); \r\n        else\r\n            echo $REPLY; \r\n        fi; \r\n    done < <( workspace );\r\n}\r\n```\r\n@roma0615 does this work on your machine?"}}
{"actor":{"display_login":"matthias-t"}}