Skip to content

fix: ターミナルコマンドのバグ3件 - #48

Merged
zakiPoteto merged 5 commits into
mainfrom
fix/terminal-commands
Oct 27, 2026
Merged

zakiPoteto merged 5 commits into
mainfrom
fix/terminal-commands

Conversation

@zakiPoteto

Copy link
Copy Markdown
Owner

Closes #41
Closes #42
Closes #43

Summary

 executeCommand(raw)
+  FLAG_SPECS[cmd] があれば、許可外のフラグで illegal option を返す
   switch (cmd)
-    case "about"
+    case "about" | "whoami"
     case "ls -l"
-      date.padEnd(16)            // 文字数ベースで全角がずれる
+      date + 空白(最大表示幅 - 表示幅)   // 全角=幅2
-      files.map((f) => ...)      // 関数 f(flag) をシャドーイング
+      files.map((name) => ...)

 src/data/commands.ts
+  PROJECT_LINKS / KNOWN_COMMANDS をファイル先頭へ移動(読み込み順の問題を回避)

Evidence

コンパイルした executeCommand を Node で直接実行して確認。

  • Before: whoami → command not found / ls -z → 黙って無視 / ls projects -l → 長い日付で列がずれる
    After:
    > whoami          → 自己紹介が表示される
    > ls -z           → ls: illegal option -- z
                        usage: ls [-la1] [dir]
    > open --foo      → open: illegal option -- --foo
    > whoamo          → Did you mean: whoami?
    > ls projects -l  → 日付列が最大幅で揃う
    
  • tsc --noEmit 通過
  • ブラウザ上のターミナルでの目視確認は未実施

Merge Danger

Door: two-way

Blast Radius: ターミナルコマンドのみ

ls / cat / open に許可外のフラグを渡すとエラーになる(従来は黙って無視)。

🤖 Generated with Claude Code

zakiPoteto and others added 3 commits October 27, 2026 14:44
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
portfolio-web Ready Ready Preview Oct 27, 2026 5:50am UTC

zakiPoteto and others added 2 commits October 27, 2026 14:49
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zakiPoteto
zakiPoteto merged commit 2d2d4ff into main Oct 27, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — fa7114a6 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant