Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use runtime alias strategy #2

Merged
merged 7 commits into from Feb 15, 2021
Merged

feat: use runtime alias strategy #2

merged 7 commits into from Feb 15, 2021

Conversation

cmoog
Copy link
Contributor

@cmoog cmoog commented Feb 14, 2021

The existing shell init strategy lends itself to frequent state errors as VSCode sessions start and stop. It also carries the limitation of having to restart the shell after you start the VSCode session.

Executing the code_connect.py script before every call to code ensures that the proper socket is detected without fail. The latency drawback is nearly imperceivable, clocking in between 30-60 ms.

With this approach, we can do away with activate.sh and activate.fish... instead all we need is a simple alias like so

function code
  ~/.local/share/code-connect/code_connect.py $argv
end

@cmoog
Copy link
Contributor Author

cmoog commented Feb 14, 2021

Obviously, this would have broader implications for theREADME.md as well as https://github.com/chvolkmann/code-connect-fish-plugin. @chvolkmann let me know if this is something you're open to merging into your mainline.

@chvolkmann
Copy link
Owner

Looks good so far! Had the plan to implement the validity check before every code call somewhere in the future, so I really appreciate the pull request!

Can you make sure to enable edit permissions to the PR once it's ready? Couldn't mark the previous PR as merged.

@cmoog
Copy link
Contributor Author

cmoog commented Feb 14, 2021

Hopefully the permissions issue is fixed now.
Screen Shot 2021-02-14 at 5 16 53 PM

@cmoog cmoog marked this pull request as ready for review February 14, 2021 23:18
@chvolkmann chvolkmann self-assigned this Feb 14, 2021
@chvolkmann chvolkmann added the enhancement New feature or request label Feb 14, 2021
@chvolkmann chvolkmann marked this pull request as draft February 15, 2021 00:05
@chvolkmann chvolkmann changed the base branch from main to dev February 15, 2021 00:45
@chvolkmann chvolkmann marked this pull request as ready for review February 15, 2021 00:45
@chvolkmann
Copy link
Owner

chvolkmann commented Feb 15, 2021

I've unclutted main() a bit and updated the README's usage instructions. Both bash and fish support

alias code="/path/to/code_connect.py"

Thanks again for your contribution, I really appreciate it 🥳

@chvolkmann chvolkmann merged commit 0a212da into chvolkmann:dev Feb 15, 2021
@cmoog cmoog deleted the runtime-exec branch February 15, 2021 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants