
${…} が化ける日 ― VS Code から Mind を実行するThe Day ${…} Breaks: Running Mind from VS Code
MindLS 0.2.1 は、エディター右上の ▶ ボタンから Mind-Docker 上の Mind 8 for Linux で .src をビルドし、統合ターミナルで実行できるようにした。パスや変数展開の落とし穴とその安全対策を、修正履歴に沿って解説しており、拡張機能の開発者に役立つ。
MindLS 0.2.1 adds a ▶ button in VS Code that builds .src files with Mind 8 for Linux on Mind-Docker and runs them in the terminal. It walks through path, variable-expansion and security pitfalls, useful for extension authors.
AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (qiita.com) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (qiita.com).
日本語プログラミング言語 Mind 向けの Language Server と VS Code 拡張 MindLS が 0.2.1 になり、エディターから直接プログラムを実行できるようになった。右上の ▶ を押すだけでビルドから実行まで済むが、開いているフォルダーのソースをそのまま動かす機能なので、実装上の細かな落とし穴がセキュリティにも関わると解説されている。
▶ でビルドして実行
実行はエディター右上の ▶、またはコマンド「Mind: ビルドして実行」から行う。Mind-Docker 上の Mind 8 for Linux で .src をコンパイルし、成功すると統合ターミナルでそのままプログラムを実行する。入力待ちになるプログラムにはターミナルから入力でき、起動引数や標準入力ファイルは設定で渡せる。筆者は、機能としては docker run でコンパイルして実行するだけだと位置づけている。
準備の手順
まず Mind-Docker の vendor/ に Mind 8 for Linux の配布物を置き、ルートで make build を実行すると、mind-docker:8.0.08 というイメージができる。あとは UTF-8 または EUC-JP の .src を開いて ▶ を押す。拡張機能はソースを保存し、コンパイルに成功したらターミナルで実行する。実行にはワークスペースの信頼が必要とされる。
落とし穴とセキュリティ
実装では、パスの組み立て、空白や改行を含むフォルダー名、VS Code の変数展開、日本語の引数といった点で、細かな問題が続いたという。▶ は他人のリポジトリを開いて押す場面もあり得るため、こうした問題の多くがそのままセキュリティ上の問題につながると説明されている。
記事は、最終的な全体の流れと守ろうとした点を先に示し、そのうえで最初のバージョンからどのような修正を重ねて現在の形に至ったかを、修正履歴に沿って振り返る構成になっている。拡張機能を開発する人にとって参考になる内容だ。
Running Mind from VS Code
This article continues a earlier write-up about a Language Server and VS Code extension for Mind, a Japanese-language programming language, which covered completion, go-to-definition, rename and diagnostics. The new piece matters because it moves from editing support to actually executing code from the editor.
According to the author, MindLS 0.2.1 lets users click the ▶ button at the top right of the editor, or run the command "Mind: ビルドして実行", to compile a .src file with Mind 8 for Linux on Mind-Docker. The program then runs in the integrated terminal. Programs that wait for input can receive it from that terminal, and launch arguments and a standard-input file can be supplied through settings.
Mind-Docker image setup
The setup starts with preparing a Mind-Docker image. The Mind 8 for Linux distribution goes into the vendor/ directory of Mind-Docker, and running make build at the repository root produces the image mind-docker:8.0.08.
After that, the user opens a UTF-8 or EUC-JP .src file and presses ▶. The extension saves the source, and if compilation succeeds it runs the program in the integrated terminal. Running requires the workspace to be trusted. Arguments and standard input are passed via settings.
Path, variable-expansion and security pitfalls
The author describes the feature as, at its core, compiling and running with docker run. Implementation nonetheless turned up a series of small traps: assembling paths, folder names containing spaces or line breaks, VS Code variable expansion, and arguments written in Japanese.
The author stresses that ▶ executes the source in whatever folder is open, and that people sometimes press it in someone else's repository. For that reason, many of these pitfalls double as security problems.
Reviewing the fix history
The article first presents the final overall flow and what it aims to protect from a security standpoint. It then looks back at how the first version was corrected step by step to reach that design, following the fix history. The stated audience is extension developers who may run into the same issues.
ポコとTECHガイドPoko & TECH Guide
ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.
- ポコPoko▶ボタンを押すだけでMindが動くって、中ではどうなってるの?A ▶ button that just runs Mind? What's actually going on behind it?
- TECHガイドTECH Guideこの記事では、Mind-Docker上のMind 8 for Linuxで.srcをコンパイルして、成功したら統合ターミナルで実行する流れだよ。入力待ちもターミナルから打てるんだ。Per the post, it compiles the .src with Mind 8 for Linux on Mind-Docker, then runs it in the integrated terminal if that succeeds. You can type input there too.
- ポコPokodocker runするだけなら簡単そうだけど、何が大変だったの?If it's just docker run, why was it hard?
- TECHガイドTECH Guideパスの組み立て、空白や改行を含むフォルダー名、VS Codeの変数展開、日本語の引数と、細かい落とし穴が続いたそうだよ。拡張機能を作る人に役立つ話だね。Paths, folder names with spaces or newlines, VS Code variable expansion, and Japanese arguments all caused snags. It's handy for extension authors.
- ポコPoko他人のリポジトリで▶を押すこともあるから、安全面も大事なんだね。And since you might press ▶ in someone else's repo, safety matters too, right?
- TECHガイドTECH Guideそうだね。落とし穴の多くがセキュリティにもつながるとあって、実行にはワークスペースの信頼が必要になっているよ。Right. The post says many pitfalls turn into security issues, and running requires workspace trust.
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy



![[VSCode / SSH] リモートサーバに接続しようとした時に got bad result from install script と表示されてアクセスできない](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-afbab5eb44e0b055cce1258705637a91.png%3Fixlib%3Drb-4.1.1%26w%3D1200%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLXByb2ZpbGUtaW1hZ2VzLmltZ2l4Lm5ldC9odHRwcyUzQSUyRiUyRnFpaXRhLWltYWdlLXN0b3JlLnMzLmFtYXpvbmF3cy5jb20lMkYwJTJGMzI3NDA3JTJGcHJvZmlsZS1pbWFnZXMlMkYxNTQ0OTUyMTkzP2l4bGliPXJiLTQuMS4xJmFyPTElM0ExJmZpdD1jcm9wJm1hc2s9ZWxsaXBzZSZiZz1GRkZGRkYmZm09cG5nMzImcz0yZmQ0MmM3NzYxNWFhYmRjM2Fi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