manintheit.org

manintheit.org


PlatformIO Bug with VSCode Plugin in WSL Environment

PlatformIO is widely regarded as one of the most powerful and beloved IDE solutions for embedded system development. However, I recently encountered a frustrating bug while using the PlatformIO VSCode plugin on a WSL (Windows Subsystem for Linux) system.

The issue arises because the PlatformIO plugin incorrectly detects the WSL environment as a Windows system. As a result, it creates folder structures using Windows-style paths, which causes some unexpected behavior.

For example, when trying to create something in the PlatformIO environment, such as PlatformIO/something, the plugin instead creates the path as PlatformIO\\something—introducing an unnecessary double backslash, which leads to errors in file handling.

This issue has already been reported on GitHub, and you can track its progress and potential fixes on the GitHub issue page.

Currently, there is no fix for this, but workaround.

Workaround:

#!/bin/bash
cd /home/$USER/.platformio/packages/contrib-piohome/
find . -maxdepth 1 -name "main*" -exec sed -i 's#"\\\\":"/"#"/":"/"#g' {} +

Restart VSCode after execution of above bash command.



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.