question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If TMPDIR environment variable is set, vscode integration does not accept commands

See original GitHub issue

A random piece of software on my machine (Windows 10) had set this the system environment variable TMPDIR, which caused the vscode integration to not accept commands. I believe this is because the function get_communication_dir_path() uses gettempdir(): https://github.com/knausj85/knausj_talon/blob/main/apps/vscode/command_client/command_client.py#L211-L224

which checks TMPDIR, TEMP, and TMP, in order, to choose a temporary directory.

On the extension side, node’s os.tmpdir() is used to select a temporary directory: https://github.com/pokey/command-server/blob/main/src/paths.ts#L4-L12

It’s not documented, but I believe this must not check the TMPDIR env variable, causing the two ends of the connection to choose different directories and miss each other.

(Not sure how to fix this. You could override the directory lookup, or just switch to using a socket lol.)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rntzcommented, Sep 4, 2022

I mildly prefer using the temporary directory. I’ve put my temp dir on an in-memory filesystem so that all this command client traffic doesn’t have to hit my hard drive at all.

0reactions
auscompgeekcommented, Oct 28, 2022

FWIW there’s already platform-specific behaviour here: on *nix the UID is in the directory name, but not on Windows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Terminal Profiles in Visual Studio Code
Visual Studio Code's integrated terminal allows configuring various profiles to make launching various shells easier.
Read more >
Environment variables undefined during debug. #947 - GitHub
Any env variable is not defined when im running under debugger. Ive tried to reainstall golang and vscode. No luck. Its really frustrating...
Read more >
Snakefiles and Rules — Snakemake 7.19.1 documentation
The tmpdir resource automatically leads to setting the $TMPDIR variable for shell commands, scripts, wrappers and notebooks. In cluster or cloud setups, its ......
Read more >
Working with Visual Studio Code — OpenPASS Documentation
An optimal solution would be to set the system environment variables in VSCode under settings.json . This is currently not possible. Please contact...
Read more >
Setting Up VSCode for MPI Programming | by Li Nguyen
If you don't have VSCode on your system yet, download it from their website ... that is setting the TMPDIR environment variable to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found