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

Provide an option to override request and response JSON files #28

Open
sashkachan opened this issue Aug 27, 2024 · 1 comment
Open

Provide an option to override request and response JSON files #28

sashkachan opened this issue Aug 27, 2024 · 1 comment

Comments

@sashkachan
Copy link

sashkachan commented Aug 27, 2024

Currently both python and ts rely on the function to get temporary folder location from os.
https://github.com/pokey/command-server/blob/b49e02b2bbbf91c9dacd038c2ff02a615d32b58d/src/paths.ts#L4C1-L12C2

and

https://github.com/talonhub/community/blob/0a4af444e661aa4441263175bd44e76d98d9bf94/apps/vscode/command_client/command_client.py#L213 (I understand this is from talon community and probably needs a relevant issue created)

However, there are extensions in VSCode (eg direnv) that may override the TMP folder location (think project specific shells).

Because the python code runs outside of that context, the location of {request,response}.json will be different than the one from vscode extension, which will render all talon vscode commands inoperable.

When I open a project with .envrc file and in the terminal TMP folder is changed:

echo $TMP
/var/folders/6n/qycjrd7s6x95t6nq5tgb4np00000gn/T/nix-shell.9c46CY

When I speak a command, I can see the request.json file is created elsewhere:

fd '^request.json' /
/System/Volumes/Data/private/var/folders/6n/qycjrd7s6x95t6nq5tgb4np00000gn/T/vscode-command-server-501/request.json

And there's no request.json file in the location expected by the extension:

ls  /var/folders/6n/qycjrd7s6x95t6nq5tgb4np00000gn/T/nix-shell.9c46CY/vscode-command-server-501/
response.json

The following error shows up in VS Code:

A system error occurred (EEXIST: file already exists, open '/var/folders/6n/qycjrd7s6x95t6nq5tgb4np00000gn/T/nix-shell.9c46CY/vscode-command-server-501/response.json')

I think it's a red herring, as the extension cannot find request.json file.

A way to circumvent that could be to allow overriding the expected location of request and response files.

EDIT:
This is also covered in:
https://talon.wiki/Quickstart/Non-standard%20Usage/nix#nix-with-the-community-vscode-command-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@sashkachan and others