WSL and file watchers

Answered

Is there any way to setup file watchers using a program within WSL?

Example: I want black to run as a file watcher, which can easily be done within "normal" environments by simply following the docs: https://black.readthedocs.io/en/stable/editor_integration.html

Black is installed via my virtualenv within WSL - is there any way to point a file watcher/external tool to a program inside my WSL? 

1
6 comments

Hi,

There is no such feature at the moment. Please feel free to submit a feature request about it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY

0
Avatar
Permanently deleted user

 

You can do this using `wsl` as the Program, and putting the actual command in Arguments. See image for an example running compiledb in wsl from clion

8

@... Chapeau! best tip in a long time ;)

0

I have been looking for that for a long time!

0

@... I'm DISGUSTED by how brilliant that is. Apparently even the devs didn't know about this possibility. Thank you so much!

0

@... Thanks man, spent days on this.

I had a watcher setup for my Windows projects, but using Laravel Sail now and my projects are on my WSL Ubuntu so the Windows watcher no longer worked.

For future people with a similar issue. I changed my watcher Program from

$ProjectFileDir$/node_modules/.bin/handlebars.cmd

to

wsl

and ran my Handlebars precompiler as usual in Arguments

handlebars resources/_templates/ -f resources/js/templates.js -e handlebars

0

Please sign in to leave a comment.