{"id":5291,"date":"2026-08-30T13:50:32","date_gmt":"2026-08-30T04:50:32","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/vscode-gemini-wsl-windows-dir-replace-cache-issue-2\/"},"modified":"2026-08-30T13:50:34","modified_gmt":"2026-08-30T04:50:34","slug":"vscode-gemini-wsl-windows-dir-replace-cache-issue","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/virtualization-container-wsl\/vscode-gemini-wsl-windows-dir-replace-cache-issue\/","title":{"rendered":"Solution to Cache Issues Occurring During Directory Navigation in WSL + VSCode"},"content":{"rendered":"<p>The VSCode &#8220;Remote &#8211; WSL&#8221; extension is used by many developers because it allows them to work on Windows-side projects directly from the Linux environment on WSL.<br \/>It is also common to map directories on Windows to the WSL side using symbolic links, operating them as if they were directories on the Linux side.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ln -s \/mnt\/c\/Users\/xxx\/project ~\/project<\/pre>\n<p>Combining this setup with an AI IDE such as Gemini enables an efficient development environment, but I heard that an unexpected phenomenon occurred in a certain situation.<\/p>\n<h2>When the src Directory Was Replaced on the Windows Side, the AI IDE Continued to Reference the Old Contents<\/h2>\n<p>In a certain environment, work was performed to replace the src directory on Windows with a backup.<br \/>Since the paths visible from VSCode and WSL do not change, this operation should not normally cause any problems.<\/p>\n<p>However, when asking Gemini to edit code,<br \/>a phenomenon occurred where the contents of the old src directory, which should have already been deleted, continued to be referenced.<\/p>\n<ul>\n<li>New files are not visible<\/li>\n<li>Treated as if old files still remain<\/li>\n<li>Updates under the symlink are not reflected<\/li>\n<li>Errors such as &#8220;File does not exist&#8221; or &#8220;Permission denied&#8221; occur<\/li>\n<\/ul>\n<p>Clearly, the state of the actual files and the AI IDE&#8217;s recognition do not match.<\/p>\n<h2>The Cause Was in the IDE&#8217;s Internal Cache<\/h2>\n<p>As a result of investigation, this problem was not due to a malfunction of symbolic links or an issue with WSL,<br \/>but rather because the cache held internally by the AI IDE was not updated.<\/p>\n<p>The AI IDE internally retains the following information:<\/p>\n<ul>\n<li>Directory structure at startup<\/li>\n<li>File existence determination<\/li>\n<li>Symlink resolution results<\/li>\n<li>Terminal state<\/li>\n<\/ul>\n<p>Since these may not be updated unless the process is restarted,<br \/>even if directories are completely replaced externally (such as via Windows Explorer or Git operations),<br \/>the IDE side may not notice the change.<\/p>\n<h2>The Solution is Simple: Restart the AI Terminal<\/h2>\n<p>Ultimately, this problem was resolved simply by restarting the Gemini terminal.<\/p>\n<p>By restarting, the IDE discards its internal cache and<br \/>correctly loads the new directory structure.<\/p>\n<ul>\n<li>The new src is displayed<\/li>\n<li>Old file information disappears<\/li>\n<li>The destination pointed to by the symlink is also correctly re-evaluated<\/li>\n<\/ul>\n<p>It returned to a normal state.<\/p>\n<h2>Lesson: If You Make Major Changes to the Directory Structure, Consider Restarting<\/h2>\n<p>The important lesson learned from this case is as follows:<\/p>\n<blockquote>\n<p>When replacing entire directories in a WSL + Windows configuration, restart the AI IDE (Gemini) or terminal.<\/p>\n<\/blockquote>\n<p>WSL and Windows have different mechanisms for file update notifications,<br \/>and since AI IDEs operate relying on internal caches,<br \/>sudden directory changes may not be reflected on the IDE side.<\/p>\n<p>This is a problem that can occur in a wide range of tools such as VSCode, Gemini, and Copilot.<\/p>\n<h2>Conclusion<\/h2>\n<p>The VSCode + WSL + Gemini configuration is extremely convenient, but<br \/>if you replace directories on the Windows side externally,<br \/>the AI IDE may operate while retaining the old cache.<\/p>\n<p>If you feel that files are not updated or that old contents are being referenced,<br \/>we recommend trying to restart the terminal first.<\/p>\n<p>Now that AI-assisted development has become mainstream, understanding the internal cache of tools and<br \/>resetting it as necessary is also an important point in maintaining a comfortable development environment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The VSCode &#8220;Remote &#8211; WSL&#8221; extension is used by many developers because it allows them to wor [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2491,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=2490","footnotes":""},"categories":[1171],"tags":[1006,51,105,970,1005,1000,540,251,104],"class_list":["post-5291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virtualization-container-wsl","tag-gemini","tag-git","tag-linux","tag-vscode","tag-windows","tag-wsl","tag-540","tag-251","tag-104","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5291"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5291\/revisions"}],"predecessor-version":[{"id":5294,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5291\/revisions\/5294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/2491"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}