25 Commits

Author SHA1 Message Date
Leonmmcoset
ce6d741059 修复点bug 2026-02-11 14:18:13 +08:00
Leonmmcoset
03b136fd6d 尝试but失败 2026-02-11 02:32:34 +08:00
Leonmmcoset
907cede2f6 贪吃蛇+修改命令提示符 2026-02-11 02:09:32 +08:00
Leonmmcoset
d6f11f2c8f AWA 2026-02-10 23:02:15 +08:00
Leonmmcoset
22c896e38c 更新文档 2026-02-10 01:51:31 +08:00
Leonmmcoset
25c7326bb2 软件管理器 2026-02-10 01:48:04 +08:00
Leonmmcoset
350db3140d 嘿克 2026-02-09 23:08:36 +08:00
Leonmmcoset
a02aab3b20 &&语法 2026-02-09 21:56:53 +08:00
Leonmmcoset
a7bf97727a 更新一堆 2026-02-09 21:33:21 +08:00
Leonmmcoset
d7b60faf65 输出git哈希值2
修复问号bug
2026-02-09 02:47:24 +08:00
Leonmmcoset
a01dd4e10c 输出git哈希值1 2026-02-09 02:04:58 +08:00
Leonmmcoset
9ac476e8ea 修改红屏文案 2026-02-08 23:51:15 +08:00
Leonmmcoset
ce90efeb3e 文档更新 2026-02-08 19:05:16 +08:00
Leonmmcoset
f0777b4e8b 以后就不需要再去PE格式化硬盘了,爽!! 2026-02-08 18:56:32 +08:00
Leonmmcoset
f63be62f27 磁盘1 2026-02-08 18:13:51 +08:00
Leonmmcoset
0e9e9f67a1 sudo rm -rf /* 2026-02-08 16:33:14 +08:00
Leonmmcoset
78502324e7 修复ls问题(但没有成功) 2026-02-08 13:12:55 +08:00
Leonmmcoset
ad2ed876d2 lua快捷运行 2026-02-08 01:53:59 +08:00
Leonmmcoset
4abc6e96cf 统一Usage 2026-02-08 01:22:08 +08:00
Leonmmcoset
85fa99f7bd 修改字体 2026-02-08 00:13:16 +08:00
Leonmmcoset
c819327f85 更新Lua文档 2026-02-07 18:54:10 +08:00
Leonmmcoset
a71d6c40a6 Lua TUI+祖国统一万岁! 2026-02-07 17:26:43 +08:00
Leonmmcoset
6e87e44a15 新登录页面UI 2026-02-07 14:50:39 +08:00
Leonmmcoset
ae56d2f5b1 初始配置新UI 2026-02-07 13:25:15 +08:00
Leonmmcoset
84c4900f18 TUI+统计 2026-02-07 01:16:56 +08:00
59 changed files with 5482 additions and 326 deletions

View File

@@ -0,0 +1,145 @@
# Details
Date : 2026-02-06 22:40:24
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
Total : 130 files, 46331 codes, 1235 comments, 4442 blanks, all 52008 lines
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [Branswe.md](/Branswe.md) | Markdown | 261 | 0 | 67 | 328 |
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 49 | 1 | 6 | 56 |
| [Editor/Editor.cs](/Editor/Editor.cs) | C# | 267 | 29 | 35 | 331 |
| [Editor/Nano.cs](/Editor/Nano.cs) | C# | 727 | 16 | 93 | 836 |
| [Interpreter/Branswe.cs](/Interpreter/Branswe.cs) | C# | 482 | 28 | 53 | 563 |
| [Interpreter/UniLua/ByteString.cs](/Interpreter/UniLua/ByteString.cs) | C# | 41 | 0 | 7 | 48 |
| [Interpreter/UniLua/Coder.cs](/Interpreter/UniLua/Coder.cs) | C# | 1,101 | 26 | 157 | 1,284 |
| [Interpreter/UniLua/Common.cs](/Interpreter/UniLua/Common.cs) | C# | 99 | 3 | 27 | 129 |
| [Interpreter/UniLua/Do.cs](/Interpreter/UniLua/Do.cs) | C# | 269 | 25 | 50 | 344 |
| [Interpreter/UniLua/Dump.cs](/Interpreter/UniLua/Dump.cs) | C# | 187 | 0 | 33 | 220 |
| [Interpreter/UniLua/LLex.cs](/Interpreter/UniLua/LLex.cs) | C# | 627 | 40 | 93 | 760 |
| [Interpreter/UniLua/LuaAPI.cs](/Interpreter/UniLua/LuaAPI.cs) | C# | 1,335 | 64 | 240 | 1,639 |
| [Interpreter/UniLua/LuaAuxLib.cs](/Interpreter/UniLua/LuaAuxLib.cs) | C# | 643 | 21 | 92 | 756 |
| [Interpreter/UniLua/LuaBaseLib.cs](/Interpreter/UniLua/LuaBaseLib.cs) | C# | 406 | 9 | 43 | 458 |
| [Interpreter/UniLua/LuaBitLib.cs](/Interpreter/UniLua/LuaBitLib.cs) | C# | 179 | 0 | 26 | 205 |
| [Interpreter/UniLua/LuaCoroLib.cs](/Interpreter/UniLua/LuaCoroLib.cs) | C# | 137 | 0 | 16 | 153 |
| [Interpreter/UniLua/LuaDebug.cs](/Interpreter/UniLua/LuaDebug.cs) | C# | 443 | 19 | 55 | 517 |
| [Interpreter/UniLua/LuaDebugLib.cs](/Interpreter/UniLua/LuaDebugLib.cs) | C# | 20 | 0 | 6 | 26 |
| [Interpreter/UniLua/LuaEncLib.cs](/Interpreter/UniLua/LuaEncLib.cs) | C# | 51 | 0 | 13 | 64 |
| [Interpreter/UniLua/LuaFile.cs](/Interpreter/UniLua/LuaFile.cs) | C# | 115 | 2 | 18 | 135 |
| [Interpreter/UniLua/LuaFunc.cs](/Interpreter/UniLua/LuaFunc.cs) | C# | 69 | 6 | 20 | 95 |
| [Interpreter/UniLua/LuaIOLib.cs](/Interpreter/UniLua/LuaIOLib.cs) | C# | 70 | 12 | 19 | 101 |
| [Interpreter/UniLua/LuaJsonLib.cs](/Interpreter/UniLua/LuaJsonLib.cs) | C# | 461 | 0 | 65 | 526 |
| [Interpreter/UniLua/LuaMathLib.cs](/Interpreter/UniLua/LuaMathLib.cs) | C# | 285 | 10 | 49 | 344 |
| [Interpreter/UniLua/LuaObject.cs](/Interpreter/UniLua/LuaObject.cs) | C# | 367 | 1 | 52 | 420 |
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 206 | 0 | 32 | 238 |
| [Interpreter/UniLua/LuaPkgLib.cs](/Interpreter/UniLua/LuaPkgLib.cs) | C# | 256 | 57 | 47 | 360 |
| [Interpreter/UniLua/LuaState.cs](/Interpreter/UniLua/LuaState.cs) | C# | 250 | 6 | 51 | 307 |
| [Interpreter/UniLua/LuaStrLib.cs](/Interpreter/UniLua/LuaStrLib.cs) | C# | 869 | 8 | 61 | 938 |
| [Interpreter/UniLua/LuaTable.cs](/Interpreter/UniLua/LuaTable.cs) | C# | 465 | 37 | 80 | 582 |
| [Interpreter/UniLua/LuaTableLib.cs](/Interpreter/UniLua/LuaTableLib.cs) | C# | 250 | 8 | 24 | 282 |
| [Interpreter/UniLua/OpCodes.cs](/Interpreter/UniLua/OpCodes.cs) | C# | 131 | 7 | 27 | 165 |
| [Interpreter/UniLua/Parser.cs](/Interpreter/UniLua/Parser.cs) | C# | 1,588 | 139 | 219 | 1,946 |
| [Interpreter/UniLua/TagMethod.cs](/Interpreter/UniLua/TagMethod.cs) | C# | 91 | 2 | 10 | 103 |
| [Interpreter/UniLua/ULDebug.cs](/Interpreter/UniLua/ULDebug.cs) | C# | 13 | 2 | 5 | 20 |
| [Interpreter/UniLua/Undump.cs](/Interpreter/UniLua/Undump.cs) | C# | 321 | 6 | 50 | 377 |
| [Interpreter/UniLua/Util.cs](/Interpreter/UniLua/Util.cs) | C# | 192 | 8 | 39 | 239 |
| [Interpreter/UniLua/VM.cs](/Interpreter/UniLua/VM.cs) | C# | 1,038 | 58 | 161 | 1,257 |
| [Kernel.cs](/Kernel.cs) | C# | 228 | 33 | 43 | 304 |
| [LISENCE.md](/LISENCE.md) | Markdown | 485 | 0 | 110 | 595 |
| [Logger/LogEntry.cs](/Logger/LogEntry.cs) | C# | 41 | 0 | 5 | 46 |
| [Logger/LogLevel.cs](/Logger/LogLevel.cs) | C# | 11 | 0 | 1 | 12 |
| [Logger/Logger.cs](/Logger/Logger.cs) | C# | 94 | 0 | 18 | 112 |
| [README.md](/README.md) | Markdown | 2 | 0 | 0 | 2 |
| [Settings/Settings.cs](/Settings/Settings.cs) | C# | 140 | 0 | 17 | 157 |
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 208 | 0 | 1 | 209 |
| [Shell/Commands/Editor/EditCommand.cs](/Shell/Commands/Editor/EditCommand.cs) | C# | 24 | 0 | 3 | 27 |
| [Shell/Commands/Editor/NanoCommand.cs](/Shell/Commands/Editor/NanoCommand.cs) | C# | 24 | 0 | 3 | 27 |
| [Shell/Commands/Environment/EnvCommand.cs](/Shell/Commands/Environment/EnvCommand.cs) | C# | 107 | 0 | 8 | 115 |
| [Shell/Commands/FileSystem/CatCommand.cs](/Shell/Commands/FileSystem/CatCommand.cs) | C# | 18 | 0 | 2 | 20 |
| [Shell/Commands/FileSystem/CdCommand.cs](/Shell/Commands/FileSystem/CdCommand.cs) | C# | 10 | 0 | 1 | 11 |
| [Shell/Commands/FileSystem/CopyCommand.cs](/Shell/Commands/FileSystem/CopyCommand.cs) | C# | 40 | 0 | 6 | 46 |
| [Shell/Commands/FileSystem/DiskInfoCommand.cs](/Shell/Commands/FileSystem/DiskInfoCommand.cs) | C# | 28 | 0 | 5 | 33 |
| [Shell/Commands/FileSystem/FindCommand.cs](/Shell/Commands/FileSystem/FindCommand.cs) | C# | 37 | 0 | 5 | 42 |
| [Shell/Commands/FileSystem/HeadCommand.cs](/Shell/Commands/FileSystem/HeadCommand.cs) | C# | 46 | 0 | 8 | 54 |
| [Shell/Commands/FileSystem/LsCommand.cs](/Shell/Commands/FileSystem/LsCommand.cs) | C# | 10 | 0 | 1 | 11 |
| [Shell/Commands/FileSystem/MkdirCommand.cs](/Shell/Commands/FileSystem/MkdirCommand.cs) | C# | 20 | 0 | 2 | 22 |
| [Shell/Commands/FileSystem/MoveCommand.cs](/Shell/Commands/FileSystem/MoveCommand.cs) | C# | 41 | 0 | 7 | 48 |
| [Shell/Commands/FileSystem/PwdCommand.cs](/Shell/Commands/FileSystem/PwdCommand.cs) | C# | 11 | 0 | 2 | 13 |
| [Shell/Commands/FileSystem/RenameCommand.cs](/Shell/Commands/FileSystem/RenameCommand.cs) | C# | 48 | 0 | 9 | 57 |
| [Shell/Commands/FileSystem/RmCommand.cs](/Shell/Commands/FileSystem/RmCommand.cs) | C# | 42 | 0 | 5 | 47 |
| [Shell/Commands/FileSystem/RmdirCommand.cs](/Shell/Commands/FileSystem/RmdirCommand.cs) | C# | 27 | 0 | 3 | 30 |
| [Shell/Commands/FileSystem/TailCommand.cs](/Shell/Commands/FileSystem/TailCommand.cs) | C# | 47 | 0 | 8 | 55 |
| [Shell/Commands/FileSystem/TouchCommand.cs](/Shell/Commands/FileSystem/TouchCommand.cs) | C# | 25 | 0 | 3 | 28 |
| [Shell/Commands/FileSystem/TreeCommand.cs](/Shell/Commands/FileSystem/TreeCommand.cs) | C# | 67 | 0 | 11 | 78 |
| [Shell/Commands/FileSystem/WordCountCommand.cs](/Shell/Commands/FileSystem/WordCountCommand.cs) | C# | 45 | 0 | 6 | 51 |
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 507 | 0 | 26 | 533 |
| [Shell/Commands/Info/About.cs](/Shell/Commands/Info/About.cs) | C# | 12 | 0 | 2 | 14 |
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 16 | 0 | 2 | 18 |
| [Shell/Commands/LabyrinthCommand.cs](/Shell/Commands/LabyrinthCommand.cs) | C# | 224 | 0 | 24 | 248 |
| [Shell/Commands/Power/RestartCommand.cs](/Shell/Commands/Power/RestartCommand.cs) | C# | 13 | 0 | 2 | 15 |
| [Shell/Commands/Power/ShutdownCommand.cs](/Shell/Commands/Power/ShutdownCommand.cs) | C# | 13 | 0 | 2 | 15 |
| [Shell/Commands/Script/BransweCommand.cs](/Shell/Commands/Script/BransweCommand.cs) | C# | 32 | 0 | 5 | 37 |
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 43 | 0 | 8 | 51 |
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 165 | 0 | 21 | 186 |
| [Shell/Commands/System/ClearCommand.cs](/Shell/Commands/System/ClearCommand.cs) | C# | 11 | 0 | 2 | 13 |
| [Shell/Commands/System/DateCommand.cs](/Shell/Commands/System/DateCommand.cs) | C# | 11 | 0 | 2 | 13 |
| [Shell/Commands/System/EchoCommand.cs](/Shell/Commands/System/EchoCommand.cs) | C# | 12 | 0 | 2 | 14 |
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 62 | 0 | 8 | 70 |
| [Shell/Commands/System/TimeCommand.cs](/Shell/Commands/System/TimeCommand.cs) | C# | 11 | 0 | 2 | 13 |
| [Shell/Commands/System/UptimeCommand.cs](/Shell/Commands/System/UptimeCommand.cs) | C# | 40 | 0 | 6 | 46 |
| [Shell/Commands/System/WhoamiCommand.cs](/Shell/Commands/System/WhoamiCommand.cs) | C# | 16 | 0 | 2 | 18 |
| [Shell/Commands/TestGuiCommand.cs](/Shell/Commands/TestGuiCommand.cs) | C# | 77 | 0 | 9 | 86 |
| [Shell/Commands/User/CpassCommand.cs](/Shell/Commands/User/CpassCommand.cs) | C# | 10 | 0 | 1 | 11 |
| [Shell/Commands/User/HostnameCommand.cs](/Shell/Commands/User/HostnameCommand.cs) | C# | 16 | 0 | 3 | 19 |
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 74 | 0 | 11 | 85 |
| [Shell/Commands/Utility/AliasCommand.cs](/Shell/Commands/Utility/AliasCommand.cs) | C# | 140 | 0 | 19 | 159 |
| [Shell/Commands/Utility/BackgroundCommand.cs](/Shell/Commands/Utility/BackgroundCommand.cs) | C# | 108 | 0 | 9 | 117 |
| [Shell/Commands/Utility/Base64Command.cs](/Shell/Commands/Utility/Base64Command.cs) | C# | 58 | 0 | 10 | 68 |
| [Shell/Commands/Utility/BeepCommand.cs](/Shell/Commands/Utility/BeepCommand.cs) | C# | 11 | 0 | 2 | 13 |
| [Shell/Commands/Utility/CalcCommand.cs](/Shell/Commands/Utility/CalcCommand.cs) | C# | 56 | 0 | 4 | 60 |
| [Shell/Commands/Utility/CalendarCommand.cs](/Shell/Commands/Utility/CalendarCommand.cs) | C# | 57 | 0 | 13 | 70 |
| [Shell/Commands/Utility/HistoryCommand.cs](/Shell/Commands/Utility/HistoryCommand.cs) | C# | 15 | 0 | 2 | 17 |
| [Shell/Commands/Utility/PromptCommand.cs](/Shell/Commands/Utility/PromptCommand.cs) | C# | 18 | 0 | 2 | 20 |
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 1,458 | 23 | 265 | 1,746 |
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 400 | 17 | 40 | 457 |
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 683 | 22 | 105 | 810 |
| [UI/CUI.cs](/UI/CUI.cs) | C# | 122 | 8 | 28 | 158 |
| [Utils/Base64.cs](/Utils/Base64.cs) | C# | 86 | 56 | 22 | 164 |
| [Utils/EnvironmentVariableManager.cs](/Utils/EnvironmentVariableManager.cs) | C# | 151 | 5 | 17 | 173 |
| [Utils/NetworkConfigManager.cs](/Utils/NetworkConfigManager.cs) | C# | 111 | 0 | 16 | 127 |
| [Utils/SHA256.cs](/Utils/SHA256.cs) | C# | 179 | 6 | 41 | 226 |
| [Utils/Version.cs](/Utils/Version.cs) | C# | 23 | 0 | 5 | 28 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vue\_devtools-api.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vue_devtools-api.js) | JavaScript | 4,356 | 145 | 5 | 4,506 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress\_shared.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress_shared.js) | JavaScript | 134 | 2 | 1 | 137 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/\_metadata.json](/docs/cmleonos/docs/.vuepress/.cache/deps/_metadata.json) | JSON | 37 | 0 | 0 | 37 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js](/docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js) | JavaScript | 12,582 | 238 | 5 | 12,825 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/package.json](/docs/cmleonos/docs/.vuepress/.cache/deps/package.json) | JSON | 3 | 0 | 1 | 4 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js) | JavaScript | 2,371 | 25 | 9 | 2,405 |
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue.js) | JavaScript | 346 | 0 | 1 | 347 |
| [docs/cmleonos/docs/.vuepress/config.js](/docs/cmleonos/docs/.vuepress/config.js) | JavaScript | 12 | 1 | 7 | 20 |
| [docs/cmleonos/docs/.vuepress/dist/404.html](/docs/cmleonos/docs/.vuepress/dist/404.html) | HTML | 40 | 0 | 4 | 44 |
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js) | JavaScript | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js) | JavaScript | 28 | 4 | 1 | 33 |
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js) | JavaScript | 143 | 0 | 1 | 144 |
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D\_vM18Nz.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D_vM18Nz.js) | JavaScript | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js) | JavaScript | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js) | JavaScript | 297 | 0 | 1 | 298 |
| [docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css](/docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css) | PostCSS | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 182 | 0 | 4 | 186 |
| [docs/cmleonos/docs/.vuepress/dist/get-started.html](/docs/cmleonos/docs/.vuepress/dist/get-started.html) | HTML | 40 | 0 | 4 | 44 |
| [docs/cmleonos/docs/.vuepress/dist/index.html](/docs/cmleonos/docs/.vuepress/dist/index.html) | HTML | 40 | 0 | 4 | 44 |
| [docs/cmleonos/docs/.vuepress/dist/lua.html](/docs/cmleonos/docs/.vuepress/dist/lua.html) | HTML | 336 | 0 | 4 | 340 |
| [docs/cmleonos/docs/README.md](/docs/cmleonos/docs/README.md) | Markdown | 33 | 0 | 4 | 37 |
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 629 | 0 | 191 | 820 |
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 14 | 0 | 3 | 17 |
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 940 | 0 | 339 | 1,279 |
| [docs/cmleonos/package.json](/docs/cmleonos/package.json) | JSON | 20 | 0 | 1 | 21 |
| [docs/cmleonos/pnpm-lock.yaml](/docs/cmleonos/pnpm-lock.yaml) | YAML | 2,410 | 0 | 674 | 3,084 |
| [global.json](/global.json) | JSON | 6 | 0 | 0 | 6 |
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,36 @@
# Diff Details
Date : 2026-02-06 22:40:24
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
Total : 21 files, 692 codes, 0 comments, 53 blanks, all 745 lines
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 3 | 0 | 0 | 3 |
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 351 | 0 | 11 | 362 |
| [Shell/Commands/LabyrinthCommand.cs](/Shell/Commands/LabyrinthCommand.cs) | C# | 224 | 0 | 24 | 248 |
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 10 | 0 | 3 | 13 |
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 10 | 0 | 3 | 13 |
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 7 | 0 | 1 | 8 |
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 38 | 0 | 4 | 42 |
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js) | JavaScript | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-xATCGIq8.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-xATCGIq8.js) | JavaScript | -1 | 0 | -1 | -2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js) | JavaScript | 28 | 4 | 1 | 33 |
| [docs/cmleonos/docs/.vuepress/dist/assets/app-DOooOitT.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-DOooOitT.js) | JavaScript | -28 | -4 | -1 | -33 |
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-2c\_EJOV\_.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-2c_EJOV_.js) | JavaScript | -135 | 0 | -1 | -136 |
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js) | JavaScript | 143 | 0 | 1 | 144 |
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D7YgC\_d3.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D7YgC_d3.js) | JavaScript | -1 | 0 | -1 | -2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D\_vM18Nz.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D_vM18Nz.js) | JavaScript | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DOUHF5Iy.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DOUHF5Iy.js) | JavaScript | -1 | 0 | -1 | -2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js) | JavaScript | 1 | 0 | 1 | 2 |
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-D4WURWuq.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-D4WURWuq.js) | JavaScript | -297 | 0 | -1 | -298 |
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js) | JavaScript | 297 | 0 | 1 | 298 |
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 8 | 0 | 0 | 8 |
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 33 | 0 | 7 | 40 |
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details

View File

@@ -0,0 +1,23 @@
"filename", "language", "C#", "Markdown", "HTML", "JavaScript", "comment", "blank", "total"
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 3, 0, 0, 0, 0, 0, 3
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 351, 0, 0, 0, 0, 11, 362
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 0, 24, 248
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 10, 0, 0, 0, 0, 3, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 10, 0, 0, 0, 0, 3, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 7, 0, 0, 0, 0, 1, 8
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 38, 0, 0, 0, 0, 4, 42
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js", "JavaScript", 0, 0, 0, 1, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-xATCGIq8.js", "JavaScript", 0, 0, 0, -1, 0, -1, -2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js", "JavaScript", 0, 0, 0, 28, 4, 1, 33
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-DOooOitT.js", "JavaScript", 0, 0, 0, -28, -4, -1, -33
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-2c_EJOV_.js", "JavaScript", 0, 0, 0, -135, 0, -1, -136
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js", "JavaScript", 0, 0, 0, 143, 0, 1, 144
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D7YgC_d3.js", "JavaScript", 0, 0, 0, -1, 0, -1, -2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js", "JavaScript", 0, 0, 0, 1, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DOUHF5Iy.js", "JavaScript", 0, 0, 0, -1, 0, -1, -2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js", "JavaScript", 0, 0, 0, 1, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-D4WURWuq.js", "JavaScript", 0, 0, 0, -297, 0, -1, -298
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js", "JavaScript", 0, 0, 0, 297, 0, 1, 298
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 8, 0, 0, 0, 8
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 33, 0, 0, 0, 7, 40
"Total", "-", 643, 33, 8, 8, 0, 53, 745
1 filename language C# Markdown HTML JavaScript comment blank total
2 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs C# 3 0 0 0 0 0 3
3 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs C# 351 0 0 0 0 11 362
4 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs C# 224 0 0 0 0 24 248
5 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs C# 10 0 0 0 0 3 13
6 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs C# 10 0 0 0 0 3 13
7 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs C# 7 0 0 0 0 1 8
8 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs C# 38 0 0 0 0 4 42
9 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js JavaScript 0 0 0 1 0 1 2
10 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-xATCGIq8.js JavaScript 0 0 0 -1 0 -1 -2
11 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js JavaScript 0 0 0 28 4 1 33
12 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-DOooOitT.js JavaScript 0 0 0 -28 -4 -1 -33
13 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-2c_EJOV_.js JavaScript 0 0 0 -135 0 -1 -136
14 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js JavaScript 0 0 0 143 0 1 144
15 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D7YgC_d3.js JavaScript 0 0 0 -1 0 -1 -2
16 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js JavaScript 0 0 0 1 0 1 2
17 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DOUHF5Iy.js JavaScript 0 0 0 -1 0 -1 -2
18 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js JavaScript 0 0 0 1 0 1 2
19 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-D4WURWuq.js JavaScript 0 0 0 -297 0 -1 -298
20 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js JavaScript 0 0 0 297 0 1 298
21 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html HTML 0 0 8 0 0 0 8
22 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md Markdown 0 33 0 0 0 7 40
23 Total - 643 33 8 8 0 53 745

View File

@@ -0,0 +1,40 @@
# Diff Summary
Date : 2026-02-06 22:40:24
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
Total : 21 files, 692 codes, 0 comments, 53 blanks, all 745 lines
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| C# | 7 | 643 | 0 | 46 | 689 |
| Markdown | 1 | 33 | 0 | 7 | 40 |
| HTML | 1 | 8 | 0 | 0 | 8 |
| JavaScript | 12 | 8 | 0 | 0 | 8 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 21 | 692 | 0 | 53 | 745 |
| Shell | 6 | 605 | 0 | 42 | 647 |
| Shell (Files) | 2 | 10 | 0 | 1 | 11 |
| Shell\\Commands | 4 | 595 | 0 | 41 | 636 |
| Shell\\Commands (Files) | 1 | 224 | 0 | 24 | 248 |
| Shell\\Commands\\Help | 1 | 351 | 0 | 11 | 362 |
| Shell\\Commands\\System | 1 | 10 | 0 | 3 | 13 |
| Shell\\Commands\\User | 1 | 10 | 0 | 3 | 13 |
| System | 1 | 38 | 0 | 4 | 42 |
| docs | 14 | 49 | 0 | 7 | 56 |
| docs\\cmleonos | 14 | 49 | 0 | 7 | 56 |
| docs\\cmleonos\\docs | 14 | 49 | 0 | 7 | 56 |
| docs\\cmleonos\\docs (Files) | 1 | 33 | 0 | 7 | 40 |
| docs\\cmleonos\\docs\\.vuepress | 13 | 16 | 0 | 0 | 16 |
| docs\\cmleonos\\docs\\.vuepress\\dist | 13 | 16 | 0 | 0 | 16 |
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 1 | 8 | 0 | 0 | 8 |
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 12 | 8 | 0 | 0 | 8 |
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,64 @@
Date : 2026-02-06 22:40:24
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
Total : 21 files, 692 codes, 0 comments, 53 blanks, all 745 lines
Languages
+------------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+------------+------------+------------+------------+------------+------------+
| C# | 7 | 643 | 0 | 46 | 689 |
| Markdown | 1 | 33 | 0 | 7 | 40 |
| HTML | 1 | 8 | 0 | 0 | 8 |
| JavaScript | 12 | 8 | 0 | 0 | 8 |
+------------+------------+------------+------------+------------+------------+
Directories
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| . | 21 | 692 | 0 | 53 | 745 |
| Shell | 6 | 605 | 0 | 42 | 647 |
| Shell (Files) | 2 | 10 | 0 | 1 | 11 |
| Shell\Commands | 4 | 595 | 0 | 41 | 636 |
| Shell\Commands (Files) | 1 | 224 | 0 | 24 | 248 |
| Shell\Commands\Help | 1 | 351 | 0 | 11 | 362 |
| Shell\Commands\System | 1 | 10 | 0 | 3 | 13 |
| Shell\Commands\User | 1 | 10 | 0 | 3 | 13 |
| System | 1 | 38 | 0 | 4 | 42 |
| docs | 14 | 49 | 0 | 7 | 56 |
| docs\cmleonos | 14 | 49 | 0 | 7 | 56 |
| docs\cmleonos\docs | 14 | 49 | 0 | 7 | 56 |
| docs\cmleonos\docs (Files) | 1 | 33 | 0 | 7 | 40 |
| docs\cmleonos\docs\.vuepress | 13 | 16 | 0 | 0 | 16 |
| docs\cmleonos\docs\.vuepress\dist | 13 | 16 | 0 | 0 | 16 |
| docs\cmleonos\docs\.vuepress\dist (Files) | 1 | 8 | 0 | 0 | 8 |
| docs\cmleonos\docs\.vuepress\dist\assets | 12 | 8 | 0 | 0 | 8 |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
Files
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 3 | 0 | 0 | 3 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 351 | 0 | 11 | 362 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs | C# | 224 | 0 | 24 | 248 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 10 | 0 | 3 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 10 | 0 | 3 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 7 | 0 | 1 | 8 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 38 | 0 | 4 | 42 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js | JavaScript | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-xATCGIq8.js | JavaScript | -1 | 0 | -1 | -2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js | JavaScript | 28 | 4 | 1 | 33 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-DOooOitT.js | JavaScript | -28 | -4 | -1 | -33 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-2c_EJOV_.js | JavaScript | -135 | 0 | -1 | -136 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js | JavaScript | 143 | 0 | 1 | 144 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D7YgC_d3.js | JavaScript | -1 | 0 | -1 | -2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js | JavaScript | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DOUHF5Iy.js | JavaScript | -1 | 0 | -1 | -2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js | JavaScript | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-D4WURWuq.js | JavaScript | -297 | 0 | -1 | -298 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js | JavaScript | 297 | 0 | 1 | 298 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 8 | 0 | 0 | 8 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 33 | 0 | 7 | 40 |
| Total | | 692 | 0 | 53 | 745 |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+

View File

@@ -0,0 +1,132 @@
"filename", "language", "C#", "Markdown", "JSON", "XML", "YAML", "HTML", "JavaScript", "PostCSS", "comment", "blank", "total"
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md", "Markdown", 0, 261, 0, 0, 0, 0, 0, 0, 0, 67, 328
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 49, 0, 0, 0, 0, 1, 6, 56
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs", "C#", 267, 0, 0, 0, 0, 0, 0, 0, 29, 35, 331
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs", "C#", 727, 0, 0, 0, 0, 0, 0, 0, 16, 93, 836
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs", "C#", 482, 0, 0, 0, 0, 0, 0, 0, 28, 53, 563
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs", "C#", 1101, 0, 0, 0, 0, 0, 0, 0, 26, 157, 1284
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs", "C#", 99, 0, 0, 0, 0, 0, 0, 0, 3, 27, 129
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs", "C#", 269, 0, 0, 0, 0, 0, 0, 0, 25, 50, 344
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs", "C#", 187, 0, 0, 0, 0, 0, 0, 0, 0, 33, 220
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs", "C#", 627, 0, 0, 0, 0, 0, 0, 0, 40, 93, 760
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs", "C#", 1335, 0, 0, 0, 0, 0, 0, 0, 64, 240, 1639
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs", "C#", 643, 0, 0, 0, 0, 0, 0, 0, 21, 92, 756
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs", "C#", 406, 0, 0, 0, 0, 0, 0, 0, 9, 43, 458
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 26, 205
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs", "C#", 137, 0, 0, 0, 0, 0, 0, 0, 0, 16, 153
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs", "C#", 443, 0, 0, 0, 0, 0, 0, 0, 19, 55, 517
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 6, 26
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs", "C#", 51, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs", "C#", 115, 0, 0, 0, 0, 0, 0, 0, 2, 18, 135
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs", "C#", 69, 0, 0, 0, 0, 0, 0, 0, 6, 20, 95
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs", "C#", 70, 0, 0, 0, 0, 0, 0, 0, 12, 19, 101
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs", "C#", 461, 0, 0, 0, 0, 0, 0, 0, 0, 65, 526
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs", "C#", 285, 0, 0, 0, 0, 0, 0, 0, 10, 49, 344
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs", "C#", 367, 0, 0, 0, 0, 0, 0, 0, 1, 52, 420
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 206, 0, 0, 0, 0, 0, 0, 0, 0, 32, 238
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs", "C#", 256, 0, 0, 0, 0, 0, 0, 0, 57, 47, 360
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 6, 51, 307
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs", "C#", 869, 0, 0, 0, 0, 0, 0, 0, 8, 61, 938
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs", "C#", 465, 0, 0, 0, 0, 0, 0, 0, 37, 80, 582
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 8, 24, 282
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs", "C#", 131, 0, 0, 0, 0, 0, 0, 0, 7, 27, 165
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs", "C#", 1588, 0, 0, 0, 0, 0, 0, 0, 139, 219, 1946
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs", "C#", 91, 0, 0, 0, 0, 0, 0, 0, 2, 10, 103
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 2, 5, 20
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs", "C#", 321, 0, 0, 0, 0, 0, 0, 0, 6, 50, 377
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs", "C#", 192, 0, 0, 0, 0, 0, 0, 0, 8, 39, 239
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs", "C#", 1038, 0, 0, 0, 0, 0, 0, 0, 58, 161, 1257
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 228, 0, 0, 0, 0, 0, 0, 0, 33, 43, 304
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md", "Markdown", 0, 485, 0, 0, 0, 0, 0, 0, 0, 110, 595
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 5, 46
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs", "C#", 94, 0, 0, 0, 0, 0, 0, 0, 0, 18, 112
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md", "Markdown", 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 17, 157
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 208, 0, 0, 0, 0, 0, 0, 0, 0, 1, 209
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 107, 0, 0, 0, 0, 0, 0, 0, 0, 8, 115
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 5, 33
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs", "C#", 37, 0, 0, 0, 0, 0, 0, 0, 0, 5, 42
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs", "C#", 46, 0, 0, 0, 0, 0, 0, 0, 0, 8, 54
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 2, 22
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs", "C#", 48, 0, 0, 0, 0, 0, 0, 0, 0, 9, 57
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 42, 0, 0, 0, 0, 0, 0, 0, 0, 5, 47
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs", "C#", 47, 0, 0, 0, 0, 0, 0, 0, 0, 8, 55
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs", "C#", 25, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs", "C#", 67, 0, 0, 0, 0, 0, 0, 0, 0, 11, 78
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs", "C#", 45, 0, 0, 0, 0, 0, 0, 0, 0, 6, 51
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 507, 0, 0, 0, 0, 0, 0, 0, 0, 26, 533
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 0, 0, 0, 0, 0, 24, 248
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 32, 0, 0, 0, 0, 0, 0, 0, 0, 5, 37
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 43, 0, 0, 0, 0, 0, 0, 0, 0, 8, 51
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 21, 186
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 8, 70
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs", "C#", 77, 0, 0, 0, 0, 0, 0, 0, 0, 9, 86
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 74, 0, 0, 0, 0, 0, 0, 0, 0, 11, 85
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 19, 159
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs", "C#", 108, 0, 0, 0, 0, 0, 0, 0, 0, 9, 117
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 58, 0, 0, 0, 0, 0, 0, 0, 0, 10, 68
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs", "C#", 56, 0, 0, 0, 0, 0, 0, 0, 0, 4, 60
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs", "C#", 57, 0, 0, 0, 0, 0, 0, 0, 0, 13, 70
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs", "C#", 15, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 1458, 0, 0, 0, 0, 0, 0, 0, 23, 265, 1746
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 400, 0, 0, 0, 0, 0, 0, 0, 17, 40, 457
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 683, 0, 0, 0, 0, 0, 0, 0, 22, 105, 810
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs", "C#", 122, 0, 0, 0, 0, 0, 0, 0, 8, 28, 158
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs", "C#", 86, 0, 0, 0, 0, 0, 0, 0, 56, 22, 164
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs", "C#", 151, 0, 0, 0, 0, 0, 0, 0, 5, 17, 173
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs", "C#", 111, 0, 0, 0, 0, 0, 0, 0, 0, 16, 127
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 6, 41, 226
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 23, 0, 0, 0, 0, 0, 0, 0, 0, 5, 28
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js", "JavaScript", 0, 0, 0, 0, 0, 0, 4356, 0, 145, 5, 4506
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js", "JavaScript", 0, 0, 0, 0, 0, 0, 134, 0, 2, 1, 137
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json", "JSON", 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 37
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 12582, 0, 238, 5, 12825
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json", "JSON", 0, 0, 3, 0, 0, 0, 0, 0, 0, 1, 4
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js", "JavaScript", 0, 0, 0, 0, 0, 0, 2371, 0, 25, 9, 2405
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js", "JavaScript", 0, 0, 0, 0, 0, 0, 346, 0, 0, 1, 347
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js", "JavaScript", 0, 0, 0, 0, 0, 0, 12, 0, 1, 7, 20
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html", "HTML", 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js", "JavaScript", 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js", "JavaScript", 0, 0, 0, 0, 0, 0, 28, 0, 4, 1, 33
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js", "JavaScript", 0, 0, 0, 0, 0, 0, 143, 0, 0, 1, 144
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js", "JavaScript", 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js", "JavaScript", 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js", "JavaScript", 0, 0, 0, 0, 0, 0, 297, 0, 0, 1, 298
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css", "PostCSS", 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 0, 0, 0, 182, 0, 0, 0, 4, 186
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html", "HTML", 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html", "HTML", 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html", "HTML", 0, 0, 0, 0, 0, 336, 0, 0, 0, 4, 340
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md", "Markdown", 0, 33, 0, 0, 0, 0, 0, 0, 0, 4, 37
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 629, 0, 0, 0, 0, 0, 0, 0, 191, 820
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 17
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 940, 0, 0, 0, 0, 0, 0, 0, 339, 1279
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json", "JSON", 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 21
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml", "YAML", 0, 0, 0, 0, 2410, 0, 0, 0, 0, 674, 3084
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json", "JSON", 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 6
"Total", "-", 20531, 2364, 66, 49, 2410, 638, 20272, 1, 1235, 4442, 52008
1 filename language C# Markdown JSON XML YAML HTML JavaScript PostCSS comment blank total
2 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md Markdown 0 261 0 0 0 0 0 0 0 67 328
3 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj XML 0 0 0 49 0 0 0 0 1 6 56
4 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs C# 267 0 0 0 0 0 0 0 29 35 331
5 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs C# 727 0 0 0 0 0 0 0 16 93 836
6 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs C# 482 0 0 0 0 0 0 0 28 53 563
7 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs C# 41 0 0 0 0 0 0 0 0 7 48
8 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs C# 1101 0 0 0 0 0 0 0 26 157 1284
9 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs C# 99 0 0 0 0 0 0 0 3 27 129
10 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs C# 269 0 0 0 0 0 0 0 25 50 344
11 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs C# 187 0 0 0 0 0 0 0 0 33 220
12 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs C# 627 0 0 0 0 0 0 0 40 93 760
13 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs C# 1335 0 0 0 0 0 0 0 64 240 1639
14 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs C# 643 0 0 0 0 0 0 0 21 92 756
15 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs C# 406 0 0 0 0 0 0 0 9 43 458
16 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs C# 179 0 0 0 0 0 0 0 0 26 205
17 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs C# 137 0 0 0 0 0 0 0 0 16 153
18 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs C# 443 0 0 0 0 0 0 0 19 55 517
19 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs C# 20 0 0 0 0 0 0 0 0 6 26
20 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs C# 51 0 0 0 0 0 0 0 0 13 64
21 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs C# 115 0 0 0 0 0 0 0 2 18 135
22 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs C# 69 0 0 0 0 0 0 0 6 20 95
23 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs C# 70 0 0 0 0 0 0 0 12 19 101
24 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs C# 461 0 0 0 0 0 0 0 0 65 526
25 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs C# 285 0 0 0 0 0 0 0 10 49 344
26 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs C# 367 0 0 0 0 0 0 0 1 52 420
27 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs C# 206 0 0 0 0 0 0 0 0 32 238
28 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs C# 256 0 0 0 0 0 0 0 57 47 360
29 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs C# 250 0 0 0 0 0 0 0 6 51 307
30 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs C# 869 0 0 0 0 0 0 0 8 61 938
31 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs C# 465 0 0 0 0 0 0 0 37 80 582
32 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs C# 250 0 0 0 0 0 0 0 8 24 282
33 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs C# 131 0 0 0 0 0 0 0 7 27 165
34 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs C# 1588 0 0 0 0 0 0 0 139 219 1946
35 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs C# 91 0 0 0 0 0 0 0 2 10 103
36 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs C# 13 0 0 0 0 0 0 0 2 5 20
37 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs C# 321 0 0 0 0 0 0 0 6 50 377
38 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs C# 192 0 0 0 0 0 0 0 8 39 239
39 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs C# 1038 0 0 0 0 0 0 0 58 161 1257
40 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs C# 228 0 0 0 0 0 0 0 33 43 304
41 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md Markdown 0 485 0 0 0 0 0 0 0 110 595
42 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs C# 41 0 0 0 0 0 0 0 0 5 46
43 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs C# 11 0 0 0 0 0 0 0 0 1 12
44 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs C# 94 0 0 0 0 0 0 0 0 18 112
45 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md Markdown 0 2 0 0 0 0 0 0 0 0 2
46 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs C# 140 0 0 0 0 0 0 0 0 17 157
47 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs C# 208 0 0 0 0 0 0 0 0 1 209
48 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs C# 24 0 0 0 0 0 0 0 0 3 27
49 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs C# 24 0 0 0 0 0 0 0 0 3 27
50 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs C# 107 0 0 0 0 0 0 0 0 8 115
51 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs C# 18 0 0 0 0 0 0 0 0 2 20
52 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs C# 10 0 0 0 0 0 0 0 0 1 11
53 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs C# 40 0 0 0 0 0 0 0 0 6 46
54 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs C# 28 0 0 0 0 0 0 0 0 5 33
55 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs C# 37 0 0 0 0 0 0 0 0 5 42
56 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs C# 46 0 0 0 0 0 0 0 0 8 54
57 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs C# 10 0 0 0 0 0 0 0 0 1 11
58 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs C# 20 0 0 0 0 0 0 0 0 2 22
59 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs C# 41 0 0 0 0 0 0 0 0 7 48
60 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs C# 11 0 0 0 0 0 0 0 0 2 13
61 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs C# 48 0 0 0 0 0 0 0 0 9 57
62 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs C# 42 0 0 0 0 0 0 0 0 5 47
63 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs C# 27 0 0 0 0 0 0 0 0 3 30
64 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs C# 47 0 0 0 0 0 0 0 0 8 55
65 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs C# 25 0 0 0 0 0 0 0 0 3 28
66 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs C# 67 0 0 0 0 0 0 0 0 11 78
67 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs C# 45 0 0 0 0 0 0 0 0 6 51
68 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs C# 507 0 0 0 0 0 0 0 0 26 533
69 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs C# 12 0 0 0 0 0 0 0 0 2 14
70 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs C# 16 0 0 0 0 0 0 0 0 2 18
71 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs C# 224 0 0 0 0 0 0 0 0 24 248
72 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs C# 13 0 0 0 0 0 0 0 0 2 15
73 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs C# 13 0 0 0 0 0 0 0 0 2 15
74 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs C# 32 0 0 0 0 0 0 0 0 5 37
75 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs C# 43 0 0 0 0 0 0 0 0 8 51
76 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs C# 165 0 0 0 0 0 0 0 0 21 186
77 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs C# 11 0 0 0 0 0 0 0 0 2 13
78 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs C# 11 0 0 0 0 0 0 0 0 2 13
79 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs C# 12 0 0 0 0 0 0 0 0 2 14
80 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs C# 62 0 0 0 0 0 0 0 0 8 70
81 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs C# 11 0 0 0 0 0 0 0 0 2 13
82 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs C# 40 0 0 0 0 0 0 0 0 6 46
83 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs C# 16 0 0 0 0 0 0 0 0 2 18
84 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs C# 77 0 0 0 0 0 0 0 0 9 86
85 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs C# 10 0 0 0 0 0 0 0 0 1 11
86 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs C# 16 0 0 0 0 0 0 0 0 3 19
87 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs C# 74 0 0 0 0 0 0 0 0 11 85
88 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs C# 140 0 0 0 0 0 0 0 0 19 159
89 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs C# 108 0 0 0 0 0 0 0 0 9 117
90 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs C# 58 0 0 0 0 0 0 0 0 10 68
91 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs C# 11 0 0 0 0 0 0 0 0 2 13
92 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs C# 56 0 0 0 0 0 0 0 0 4 60
93 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs C# 57 0 0 0 0 0 0 0 0 13 70
94 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs C# 15 0 0 0 0 0 0 0 0 2 17
95 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs C# 18 0 0 0 0 0 0 0 0 2 20
96 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs C# 1458 0 0 0 0 0 0 0 23 265 1746
97 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs C# 400 0 0 0 0 0 0 0 17 40 457
98 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs C# 683 0 0 0 0 0 0 0 22 105 810
99 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs C# 122 0 0 0 0 0 0 0 8 28 158
100 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs C# 86 0 0 0 0 0 0 0 56 22 164
101 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs C# 151 0 0 0 0 0 0 0 5 17 173
102 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs C# 111 0 0 0 0 0 0 0 0 16 127
103 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs C# 179 0 0 0 0 0 0 0 6 41 226
104 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs C# 23 0 0 0 0 0 0 0 0 5 28
105 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js JavaScript 0 0 0 0 0 0 4356 0 145 5 4506
106 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js JavaScript 0 0 0 0 0 0 134 0 2 1 137
107 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json JSON 0 0 37 0 0 0 0 0 0 0 37
108 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js JavaScript 0 0 0 0 0 0 12582 0 238 5 12825
109 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json JSON 0 0 3 0 0 0 0 0 0 1 4
110 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js JavaScript 0 0 0 0 0 0 2371 0 25 9 2405
111 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js JavaScript 0 0 0 0 0 0 346 0 0 1 347
112 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js JavaScript 0 0 0 0 0 0 12 0 1 7 20
113 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html HTML 0 0 0 0 0 40 0 0 0 4 44
114 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js JavaScript 0 0 0 0 0 0 1 0 0 1 2
115 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js JavaScript 0 0 0 0 0 0 28 0 4 1 33
116 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js JavaScript 0 0 0 0 0 0 143 0 0 1 144
117 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js JavaScript 0 0 0 0 0 0 1 0 0 1 2
118 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js JavaScript 0 0 0 0 0 0 1 0 0 1 2
119 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js JavaScript 0 0 0 0 0 0 297 0 0 1 298
120 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css PostCSS 0 0 0 0 0 0 0 1 0 1 2
121 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html HTML 0 0 0 0 0 182 0 0 0 4 186
122 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html HTML 0 0 0 0 0 40 0 0 0 4 44
123 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html HTML 0 0 0 0 0 40 0 0 0 4 44
124 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html HTML 0 0 0 0 0 336 0 0 0 4 340
125 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md Markdown 0 33 0 0 0 0 0 0 0 4 37
126 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md Markdown 0 629 0 0 0 0 0 0 0 191 820
127 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md Markdown 0 14 0 0 0 0 0 0 0 3 17
128 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md Markdown 0 940 0 0 0 0 0 0 0 339 1279
129 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json JSON 0 0 20 0 0 0 0 0 0 1 21
130 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml YAML 0 0 0 0 2410 0 0 0 0 674 3084
131 c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json JSON 0 0 6 0 0 0 0 0 0 0 6
132 Total - 20531 2364 66 49 2410 638 20272 1 1235 4442 52008

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,64 @@
# Summary
Date : 2026-02-06 22:40:24
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
Total : 130 files, 46331 codes, 1235 comments, 4442 blanks, all 52008 lines
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| C# | 99 | 20,531 | 819 | 2,991 | 24,341 |
| JavaScript | 12 | 20,272 | 415 | 34 | 20,721 |
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
| Markdown | 7 | 2,364 | 0 | 714 | 3,078 |
| HTML | 5 | 638 | 0 | 20 | 658 |
| JSON | 4 | 66 | 0 | 2 | 68 |
| XML | 1 | 49 | 1 | 6 | 56 |
| PostCSS | 1 | 1 | 0 | 1 | 2 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 130 | 46,331 | 1,235 | 4,442 | 52,008 |
| . (Files) | 6 | 1,031 | 34 | 226 | 1,291 |
| Editor | 2 | 994 | 45 | 128 | 1,167 |
| Interpreter | 34 | 13,057 | 604 | 1,940 | 15,601 |
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
| Interpreter\\UniLua | 33 | 12,575 | 576 | 1,887 | 15,038 |
| Logger | 3 | 146 | 0 | 24 | 170 |
| Settings | 1 | 140 | 0 | 17 | 157 |
| Shell | 50 | 4,211 | 23 | 565 | 4,799 |
| Shell (Files) | 2 | 1,666 | 23 | 266 | 1,955 |
| Shell\\Commands | 48 | 2,545 | 0 | 299 | 2,844 |
| Shell\\Commands (Files) | 2 | 301 | 0 | 33 | 334 |
| Shell\\Commands\\Editor | 2 | 48 | 0 | 6 | 54 |
| Shell\\Commands\\Environment | 1 | 107 | 0 | 8 | 115 |
| Shell\\Commands\\FileSystem | 17 | 562 | 0 | 84 | 646 |
| Shell\\Commands\\Help | 1 | 507 | 0 | 26 | 533 |
| Shell\\Commands\\Info | 2 | 28 | 0 | 4 | 32 |
| Shell\\Commands\\Power | 2 | 26 | 0 | 4 | 30 |
| Shell\\Commands\\Script | 3 | 240 | 0 | 34 | 274 |
| Shell\\Commands\\System | 7 | 163 | 0 | 24 | 187 |
| Shell\\Commands\\User | 3 | 100 | 0 | 15 | 115 |
| Shell\\Commands\\Utility | 8 | 463 | 0 | 61 | 524 |
| System | 2 | 1,083 | 39 | 145 | 1,267 |
| UI | 1 | 122 | 8 | 28 | 158 |
| Utils | 5 | 550 | 67 | 101 | 718 |
| docs | 26 | 24,997 | 415 | 1,268 | 26,680 |
| docs\\cmleonos | 26 | 24,997 | 415 | 1,268 | 26,680 |
| docs\\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
| docs\\cmleonos\\docs | 24 | 22,567 | 415 | 593 | 23,575 |
| docs\\cmleonos\\docs (Files) | 4 | 1,616 | 0 | 537 | 2,153 |
| docs\\cmleonos\\docs\\.vuepress | 20 | 20,951 | 415 | 56 | 21,422 |
| docs\\cmleonos\\docs\\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
| docs\\cmleonos\\docs\\.vuepress\\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
| docs\\cmleonos\\docs\\.vuepress\\.cache\\deps | 7 | 19,829 | 410 | 22 | 20,261 |
| docs\\cmleonos\\docs\\.vuepress\\dist | 12 | 1,110 | 4 | 27 | 1,141 |
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 5 | 638 | 0 | 20 | 658 |
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 7 | 472 | 4 | 7 | 483 |
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,197 @@
Date : 2026-02-06 22:40:24
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
Total : 130 files, 46331 codes, 1235 comments, 4442 blanks, all 52008 lines
Languages
+------------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+------------+------------+------------+------------+------------+------------+
| C# | 99 | 20,531 | 819 | 2,991 | 24,341 |
| JavaScript | 12 | 20,272 | 415 | 34 | 20,721 |
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
| Markdown | 7 | 2,364 | 0 | 714 | 3,078 |
| HTML | 5 | 638 | 0 | 20 | 658 |
| JSON | 4 | 66 | 0 | 2 | 68 |
| XML | 1 | 49 | 1 | 6 | 56 |
| PostCSS | 1 | 1 | 0 | 1 | 2 |
+------------+------------+------------+------------+------------+------------+
Directories
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| . | 130 | 46,331 | 1,235 | 4,442 | 52,008 |
| . (Files) | 6 | 1,031 | 34 | 226 | 1,291 |
| Editor | 2 | 994 | 45 | 128 | 1,167 |
| Interpreter | 34 | 13,057 | 604 | 1,940 | 15,601 |
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
| Interpreter\UniLua | 33 | 12,575 | 576 | 1,887 | 15,038 |
| Logger | 3 | 146 | 0 | 24 | 170 |
| Settings | 1 | 140 | 0 | 17 | 157 |
| Shell | 50 | 4,211 | 23 | 565 | 4,799 |
| Shell (Files) | 2 | 1,666 | 23 | 266 | 1,955 |
| Shell\Commands | 48 | 2,545 | 0 | 299 | 2,844 |
| Shell\Commands (Files) | 2 | 301 | 0 | 33 | 334 |
| Shell\Commands\Editor | 2 | 48 | 0 | 6 | 54 |
| Shell\Commands\Environment | 1 | 107 | 0 | 8 | 115 |
| Shell\Commands\FileSystem | 17 | 562 | 0 | 84 | 646 |
| Shell\Commands\Help | 1 | 507 | 0 | 26 | 533 |
| Shell\Commands\Info | 2 | 28 | 0 | 4 | 32 |
| Shell\Commands\Power | 2 | 26 | 0 | 4 | 30 |
| Shell\Commands\Script | 3 | 240 | 0 | 34 | 274 |
| Shell\Commands\System | 7 | 163 | 0 | 24 | 187 |
| Shell\Commands\User | 3 | 100 | 0 | 15 | 115 |
| Shell\Commands\Utility | 8 | 463 | 0 | 61 | 524 |
| System | 2 | 1,083 | 39 | 145 | 1,267 |
| UI | 1 | 122 | 8 | 28 | 158 |
| Utils | 5 | 550 | 67 | 101 | 718 |
| docs | 26 | 24,997 | 415 | 1,268 | 26,680 |
| docs\cmleonos | 26 | 24,997 | 415 | 1,268 | 26,680 |
| docs\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
| docs\cmleonos\docs | 24 | 22,567 | 415 | 593 | 23,575 |
| docs\cmleonos\docs (Files) | 4 | 1,616 | 0 | 537 | 2,153 |
| docs\cmleonos\docs\.vuepress | 20 | 20,951 | 415 | 56 | 21,422 |
| docs\cmleonos\docs\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
| docs\cmleonos\docs\.vuepress\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
| docs\cmleonos\docs\.vuepress\.cache\deps | 7 | 19,829 | 410 | 22 | 20,261 |
| docs\cmleonos\docs\.vuepress\dist | 12 | 1,110 | 4 | 27 | 1,141 |
| docs\cmleonos\docs\.vuepress\dist (Files) | 5 | 638 | 0 | 20 | 658 |
| docs\cmleonos\docs\.vuepress\dist\assets | 7 | 472 | 4 | 7 | 483 |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
Files
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md | Markdown | 261 | 0 | 67 | 328 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 49 | 1 | 6 | 56 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs | C# | 267 | 29 | 35 | 331 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs | C# | 727 | 16 | 93 | 836 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs | C# | 482 | 28 | 53 | 563 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs | C# | 41 | 0 | 7 | 48 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs | C# | 1,101 | 26 | 157 | 1,284 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs | C# | 99 | 3 | 27 | 129 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs | C# | 269 | 25 | 50 | 344 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs | C# | 187 | 0 | 33 | 220 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs | C# | 627 | 40 | 93 | 760 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs | C# | 1,335 | 64 | 240 | 1,639 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs | C# | 643 | 21 | 92 | 756 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs | C# | 406 | 9 | 43 | 458 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs | C# | 179 | 0 | 26 | 205 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs | C# | 137 | 0 | 16 | 153 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs | C# | 443 | 19 | 55 | 517 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs | C# | 20 | 0 | 6 | 26 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs | C# | 51 | 0 | 13 | 64 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs | C# | 115 | 2 | 18 | 135 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs | C# | 69 | 6 | 20 | 95 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs | C# | 70 | 12 | 19 | 101 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs | C# | 461 | 0 | 65 | 526 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs | C# | 285 | 10 | 49 | 344 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs | C# | 367 | 1 | 52 | 420 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 206 | 0 | 32 | 238 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs | C# | 256 | 57 | 47 | 360 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs | C# | 250 | 6 | 51 | 307 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs | C# | 869 | 8 | 61 | 938 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs | C# | 465 | 37 | 80 | 582 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs | C# | 250 | 8 | 24 | 282 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs | C# | 131 | 7 | 27 | 165 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs | C# | 1,588 | 139 | 219 | 1,946 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs | C# | 91 | 2 | 10 | 103 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs | C# | 13 | 2 | 5 | 20 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs | C# | 321 | 6 | 50 | 377 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs | C# | 192 | 8 | 39 | 239 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs | C# | 1,038 | 58 | 161 | 1,257 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 228 | 33 | 43 | 304 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md | Markdown | 485 | 0 | 110 | 595 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs | C# | 41 | 0 | 5 | 46 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs | C# | 11 | 0 | 1 | 12 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs | C# | 94 | 0 | 18 | 112 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md | Markdown | 2 | 0 | 0 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs | C# | 140 | 0 | 17 | 157 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 208 | 0 | 1 | 209 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs | C# | 24 | 0 | 3 | 27 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs | C# | 24 | 0 | 3 | 27 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs | C# | 107 | 0 | 8 | 115 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs | C# | 18 | 0 | 2 | 20 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs | C# | 10 | 0 | 1 | 11 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs | C# | 40 | 0 | 6 | 46 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs | C# | 28 | 0 | 5 | 33 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs | C# | 37 | 0 | 5 | 42 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs | C# | 46 | 0 | 8 | 54 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs | C# | 10 | 0 | 1 | 11 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs | C# | 20 | 0 | 2 | 22 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs | C# | 41 | 0 | 7 | 48 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs | C# | 11 | 0 | 2 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs | C# | 48 | 0 | 9 | 57 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs | C# | 42 | 0 | 5 | 47 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs | C# | 27 | 0 | 3 | 30 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs | C# | 47 | 0 | 8 | 55 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs | C# | 25 | 0 | 3 | 28 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs | C# | 67 | 0 | 11 | 78 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs | C# | 45 | 0 | 6 | 51 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 507 | 0 | 26 | 533 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs | C# | 12 | 0 | 2 | 14 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 16 | 0 | 2 | 18 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs | C# | 224 | 0 | 24 | 248 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs | C# | 13 | 0 | 2 | 15 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs | C# | 13 | 0 | 2 | 15 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs | C# | 32 | 0 | 5 | 37 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 43 | 0 | 8 | 51 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 165 | 0 | 21 | 186 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs | C# | 11 | 0 | 2 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs | C# | 11 | 0 | 2 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs | C# | 12 | 0 | 2 | 14 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 62 | 0 | 8 | 70 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs | C# | 11 | 0 | 2 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs | C# | 40 | 0 | 6 | 46 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs | C# | 16 | 0 | 2 | 18 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs | C# | 77 | 0 | 9 | 86 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs | C# | 10 | 0 | 1 | 11 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs | C# | 16 | 0 | 3 | 19 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 74 | 0 | 11 | 85 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs | C# | 140 | 0 | 19 | 159 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs | C# | 108 | 0 | 9 | 117 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs | C# | 58 | 0 | 10 | 68 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs | C# | 11 | 0 | 2 | 13 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs | C# | 56 | 0 | 4 | 60 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs | C# | 57 | 0 | 13 | 70 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs | C# | 15 | 0 | 2 | 17 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs | C# | 18 | 0 | 2 | 20 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 1,458 | 23 | 265 | 1,746 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 400 | 17 | 40 | 457 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 683 | 22 | 105 | 810 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs | C# | 122 | 8 | 28 | 158 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs | C# | 86 | 56 | 22 | 164 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs | C# | 151 | 5 | 17 | 173 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs | C# | 111 | 0 | 16 | 127 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs | C# | 179 | 6 | 41 | 226 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs | C# | 23 | 0 | 5 | 28 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js | JavaScript | 4,356 | 145 | 5 | 4,506 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js | JavaScript | 134 | 2 | 1 | 137 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json | JSON | 37 | 0 | 0 | 37 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js | JavaScript | 12,582 | 238 | 5 | 12,825 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json | JSON | 3 | 0 | 1 | 4 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js | JavaScript | 2,371 | 25 | 9 | 2,405 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js | JavaScript | 346 | 0 | 1 | 347 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js | JavaScript | 12 | 1 | 7 | 20 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html | HTML | 40 | 0 | 4 | 44 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js | JavaScript | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js | JavaScript | 28 | 4 | 1 | 33 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js | JavaScript | 143 | 0 | 1 | 144 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js | JavaScript | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js | JavaScript | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js | JavaScript | 297 | 0 | 1 | 298 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css | PostCSS | 1 | 0 | 1 | 2 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 182 | 0 | 4 | 186 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html | HTML | 40 | 0 | 4 | 44 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html | HTML | 40 | 0 | 4 | 44 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html | HTML | 336 | 0 | 4 | 340 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md | Markdown | 33 | 0 | 4 | 37 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 629 | 0 | 191 | 820 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 14 | 0 | 3 | 17 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 940 | 0 | 339 | 1,279 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json | JSON | 20 | 0 | 1 | 21 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml | YAML | 2,410 | 0 | 674 | 3,084 |
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json | JSON | 6 | 0 | 0 | 6 |
| Total | | 46,331 | 1,235 | 4,442 | 52,008 |
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+

2
Build.bat Normal file
View File

@@ -0,0 +1,2 @@
"D:\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" "CMLeonOS.csproj" /t:Build /p:Configuration=Fixed_Release /p:Platform=x64
@REM "C:\Program Files (x86)\VMware\VMware Workstation\vmplayer.exe" "C:\Users\leon\AppData\Roaming\Cosmos User Kit\Build\VMware\Workstation\Cosmos.vmx"

View File

@@ -6,7 +6,7 @@
<Platform>cosmos</Platform>
<SupportsX86Intrinsics>false</SupportsX86Intrinsics>
<SelfContained>True</SelfContained>
<Platforms>AnyCPU;x64</Platforms>
<Platforms>AnyCPU;x64;ARM64</Platforms>
<Configurations>Debug;Release;Fixed_Release</Configurations>
</PropertyGroup>
@@ -28,10 +28,49 @@
<CosmosDebugLevel>None</CosmosDebugLevel>
<OptimizationLevel>2</OptimizationLevel>
<VBEResolution>800x600x32</VBEResolution>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningLevel>8</WarningLevel>
<NoWarn>1603,1701;1702,8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<WarningLevel>8</WarningLevel>
<NoWarn>1603,1701;1702,8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningLevel>8</WarningLevel>
<NoWarn>1603,1701;1702,8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<WarningLevel>8</WarningLevel>
<NoWarn>1603,1701;1702,8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fixed_Release|AnyCPU'">
<WarningLevel>8</WarningLevel>
<NoWarn>1603,1701;1702,8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fixed_Release|x64'">
<WarningLevel>8</WarningLevel>
<NoWarn>1603,1701;1702,8632</NoWarn>
</PropertyGroup>
<ItemGroup>
<None Remove="font.psf" />
<None Remove="Solarize.12x29.psf" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="font.psf" />
<EmbeddedResource Include="Wallpapers\wallpaper.bmp" />
<EmbeddedResource Include="GitCommit.txt" />
<EmbeddedResource Include="LuaApps\*.lua" />
</ItemGroup>
<ItemGroup>
@@ -52,4 +91,8 @@
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260203125852" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="powershell -ExecutionPolicy Bypass -File GenerateGitCommit.ps1" WorkingDirectory="$(MSBuildProjectDirectory)" />
</Target>
</Project>

25
GenerateGitCommit.ps1 Normal file
View File

@@ -0,0 +1,25 @@
$ErrorActionPreference = "Stop"
$gitPath = "git"
$commitFile = "GitCommit.txt"
try {
$commitHash = git rev-parse HEAD 2>&1
if ($LASTEXITCODE -eq 0) {
$shortHash = $commitHash.Substring(0, 7).Trim()
$trimmedHash = $commitHash.Trim()
[System.IO.File]::WriteAllText($commitFile, $shortHash, [System.Text.Encoding]::ASCII)
Write-Host "Git Commit Hash: $shortHash" -ForegroundColor Green
Write-Host "Full Hash: $trimmedHash" -ForegroundColor Cyan
}
else {
Write-Host "Warning: Not a git repository or git not found" -ForegroundColor Yellow
Write-Host "Using default commit hash: unknown" -ForegroundColor Yellow
"unknown" | Out-File -FilePath $commitFile -Encoding UTF8
}
}
catch {
Write-Host "Error: $_" -ForegroundColor Red
"unknown" | Out-File -FilePath $commitFile -Encoding UTF8
}

1
GitCommit.txt Normal file
View File

@@ -0,0 +1 @@
03b136f

205
Kernel.cs
View File

@@ -1,19 +1,24 @@
using CMLeonOS.Logger;
using CMLeonOS.Settings;
using Cosmos.HAL;
using Cosmos.HAL.BlockDevice;
using Cosmos.HAL.Drivers.Video;
using Cosmos.System.FileSystem;
using Cosmos.System.FileSystem.FAT;
using Cosmos.System.FileSystem.VFS;
using Cosmos.System.Graphics;
using Cosmos.System.Graphics.Fonts;
using Cosmos.System.Network.Config;
using Cosmos.System.Network.IPv4.UDP.DHCP;
using Cosmos.HAL.BlockDevice;
using Cosmos.System.Network.IPv4;
using Cosmos.System.Network.IPv4.UDP.DHCP;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Sys = Cosmos.System;
using CMLeonOS.Logger;
using CMLeonOS.Settings;
namespace CMLeonOS
{
@@ -31,9 +36,40 @@ namespace CMLeonOS
public static Cosmos.HAL.NetworkDevice NetworkDevice = null;
public static string IPAddress = "Unknown";
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.font.psf")]
public static readonly byte[] file;
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.GitCommit.txt")]
public static readonly byte[] gitCommitFile;
public static void ShowError(string message)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"{message}");
Console.ResetColor();
}
protected override void BeforeRun()
{
// 我认了,我用默认字体
// try
// {
// PCScreenFont screenFont = PCScreenFont.LoadFont(file);
// VGAScreen.SetFont(screenFont.CreateVGAFont(), screenFont.Height);
// }
// catch (Exception ex)
// {
// 我不认我试着转换成Base64
// 我认了
// PCScreenFont defaultFont = PCScreenFont.Default;
// VGAScreen.SetFont(defaultFont.CreateVGAFont(), defaultFont.Height);
// Console.WriteLine($"{defaultFont.Height}");
// Console.WriteLine($"{defaultFont.Width}");
// VGAScreen.SetGraphicsMode(VGADriver.ScreenSize.Size720x480, ColorDepth.ColorDepth32);
// Console.WriteLine($"Error loading font: {ex.Message}");
// }
Console.WriteLine("Kernel load done!");
Console.WriteLine(@"-------------------------------------------------");
Console.WriteLine(@" ____ __ __ _ ___ ____ ");
@@ -73,11 +109,39 @@ namespace CMLeonOS
_logger.Info("Kernel", "Created system folder at 0:\\system");
}
// 检查并创建apps文件夹
string appsFolderPath = @"0:\apps";
if (!System.IO.Directory.Exists(appsFolderPath))
{
System.IO.Directory.CreateDirectory(appsFolderPath);
_logger.Info("Kernel", "Created apps folder at 0:\\apps");
}
// 初始化用户系统
_logger.Info("Kernel", "Initializing user system");
userSystem = new UserSystem();
_logger.Success("Kernel", "User system initialized");
// 读取 Git Commit hash
if (gitCommitFile != null && gitCommitFile.Length > 0)
{
try
{
Version.GitCommit = System.Text.Encoding.UTF8.GetString(gitCommitFile);
_logger.Info("Kernel", $"Git Commit: {Version.GitCommit}");
}
catch
{
Version.GitCommit = "unknown";
_logger.Warning("Kernel", "Failed to read Git Commit, using 'unknown'");
}
}
else
{
Version.GitCommit = "unknown";
_logger.Warning("Kernel", "Git Commit file not found, using 'unknown'");
}
// 检查env.dat文件是否存在如果不存在则创建并设置Test环境变量
string envFilePath = @"0:\system\env.dat";
if (!System.IO.File.Exists(envFilePath))
@@ -208,20 +272,131 @@ namespace CMLeonOS
}
catch (Exception ex)
{
Console.Clear();
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.White;
Console.Clear();
Console.WriteLine(":(");
Console.WriteLine("A problem has been detected and CMLeonOS has been shutdown to prevent damage to your computer.");
Console.WriteLine($"Error information: {ex.Message}");
Console.WriteLine("If this is the first time you've seen this stop error screen, restart your computer and email to leonmmcoset@outlook.com WITH THE ERROR INFORMATION for technical support.");
Console.WriteLine("Press any keys to restart.");
Console.ReadKey();
Sys.Power.Reboot();
if (ex.Message.Contains("Read only"))
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.Clear();
var formatWindow = new CMLeonOS.UI.Window(
new CMLeonOS.UI.Rect(10, 5, 60, 12),
"Format Disk",
() => { },
true
);
formatWindow.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 8);
global::System.Console.Write("Disk not formatted");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Yellow, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 9);
global::System.Console.Write("Warning: This will erase all data!");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 11);
global::System.Console.Write("Press any key to format...");
global::System.Console.ReadKey();
try {
Disk targetDisk = fs.Disks[0];
CreateMBRandPartitionTable(targetDisk);
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.Clear();
formatWindow.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 8);
global::System.Console.Write("Disk formatted successfully!");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 9);
global::System.Console.Write("Restarting in 3 seconds...");
System.Threading.Thread.Sleep(3000);
Sys.Power.Reboot();
}
catch (Exception exe)
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.Clear();
formatWindow.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 8);
global::System.Console.Write("Format failed!");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 9);
global::System.Console.Write($"Error: {exe.Message}");
global::System.Console.ReadKey();
}
}
else{
Console.Clear();
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.White;
Console.Clear();
Console.Beep();
Console.WriteLine(":(");
Console.WriteLine("A problem has been detected and CMLeonOS has been shut down to prevent damage to your computer.");
string gitCommit = "unknown";
if (gitCommitFile != null && gitCommitFile.Length > 0)
{
try
{
gitCommit = System.Text.Encoding.UTF8.GetString(gitCommitFile);
}
catch
{
}
}
Console.WriteLine($"Error information: {ex.Message}");
Console.WriteLine($"Build version: {gitCommit}");
Console.WriteLine("The operating system cannot recover from this exception and has halted immediately.");
Console.WriteLine("If this is the first time you've seen this stop error screen, restart your computer.");
Console.WriteLine("If this screen appears again, follow these steps:");
Console.WriteLine("1. Check the system logs to ensure all kernel modules are loaded correctly.");
Console.WriteLine("2. Record the system version and steps to reproduce the error.");
Console.WriteLine("3. Send an post to the CMLeonOS official forum.");
Console.WriteLine("Contact us via https://lbbs.ecuil.com/#/thread/category/10, including the error information for support.");
Console.WriteLine("Please include the error information, system build version, runtime environment, and operation steps before the crash.");
Console.WriteLine("Warning: Unsaved data in memory will be lost due to the emergency system shutdown.");
Console.WriteLine("Press any key to restart.");
Console.ReadKey();
Sys.Power.Reboot();
}
// try {
// Disk targetDisk = fs.Disks[0];
// CreateMBRandPartitionTable(targetDisk);
// }
// catch (Exception exe)
// {
// Console.WriteLine($"Error creating MBR and partition table: {exe.Message}");
// }
// Console.WriteLine("Done.");
}
}
// 我他妈居然成功了,我在没有任何文档的情况下研究出来了
private void CreateMBRandPartitionTable(Disk disk)
{
disk.Clear();
ulong diskSize = (ulong)(disk.Size / 1024 / 1024);
uint partSize = (uint)(diskSize - 2);
disk.CreatePartition((int)partSize);
var part = disk.Partitions[disk.Partitions.Count - 1];
disk.FormatPartition(0, "FAT32", true);
// Console.WriteLine($"Partition type: {part.GetType()}");
}
private void ExecuteStartupScript()
{
string startupFilePath = @"0:\system\startup.cm";

16
LuaApps.cs Normal file
View File

@@ -0,0 +1,16 @@
using IL2CPU.API.Attribs;
namespace CMLeonOS
{
public static class LuaApps
{
[ManifestResourceStream(ResourceName = "CMLeonOS.LuaApps.helloworld.lua")]
public static readonly byte[] helloworld;
[ManifestResourceStream(ResourceName = "CMLeonOS.LuaApps.testspeed.lua")]
public static readonly byte[] testspeed;
[ManifestResourceStream(ResourceName = "CMLeonOS.LuaApps.calculator.lua")]
public static readonly byte[] calculator;
}
}

98
LuaApps/calculator.lua Normal file
View File

@@ -0,0 +1,98 @@
print("====================================")
print(" Lua Calculator")
print("====================================")
print("Type 'exit' or 'quit' to exit")
print("Type 'clear' to clear the result")
print()
local result = nil
local operator = nil
local lastResult = nil
while true do
io.write("calc> ")
local input = io.read()
if input == nil or input == "" then
goto continue
end
input = input:lower()
if input == "exit" or input == "quit" then
print("Exiting calculator...")
break
elseif input == "clear" then
result = nil
operator = nil
lastResult = nil
print("Calculator cleared.")
goto continue
elseif input == "help" then
print("Available commands:")
print(" + : Addition")
print(" - : Subtraction")
print(" * : Multiplication")
print(" / : Division")
print(" ^ : Power")
print(" % : Modulo")
print(" clear : Clear calculator")
print(" exit : Exit calculator")
goto continue
end
local num = tonumber(input)
if num ~= nil then
if operator == nil then
result = num
lastResult = num
print("Result: " .. result)
else
local calcResult = nil
if operator == "+" then
calcResult = result + num
elseif operator == "-" then
calcResult = result - num
elseif operator == "*" then
calcResult = result * num
elseif operator == "/" then
if num == 0 then
print("Error: Division by zero!")
else
calcResult = result / num
end
elseif operator == "^" then
calcResult = result ^ num
elseif operator == "%" then
if num == 0 then
print("Error: Modulo by zero!")
else
calcResult = result % num
end
end
if calcResult ~= nil then
result = calcResult
lastResult = calcResult
print("Result: " .. result)
end
operator = nil
end
else
if input == "+" or input == "-" or input == "*" or input == "/" or input == "^" or input == "%" then
operator = input
print("Operator: " .. operator)
else
print("Invalid input: " .. input)
print("Type 'help' for available commands")
end
end
::continue::
end
print()
print("Final result: " .. (lastResult or "No calculation"))
print("Goodbye!")

3
LuaApps/helloworld.lua Normal file
View File

@@ -0,0 +1,3 @@
print("Hello, World!")
print("Welcome to CMLeonOS!")
print("This is a simple Lua application.")

7
LuaApps/testspeed.lua Normal file
View File

@@ -0,0 +1,7 @@
local loop = 100000000
os.timerstart()
for i = 1, loop do
-- Nothing
end
cost = os.timerstop()
print("Loop " .. loop .. ", cost " .. cost .. "s.")

View File

@@ -28,7 +28,14 @@ namespace CMLeonOS
public string CurrentDirectory
{
get { return currentDirectory; }
get
{
// if (currentDirectory == @"0:\apps")
// {
// return ":";
// }
return currentDirectory;
}
}
public void ChangeDirectory(string path)
@@ -89,7 +96,8 @@ namespace CMLeonOS
if (Directory.Exists(fullPath))
{
// 列出当前目录下的文件和子目录
Console.WriteLine($"Contents of {path}:");
string displayPath = path == "." ? CurrentDirectory : path;
Console.WriteLine($"Contents of {displayPath}:");
// 列出子目录
try

View File

@@ -306,139 +306,189 @@ namespace CMLeonOS
public void FirstTimeSetup()
{
Console.WriteLine("====================================");
Console.WriteLine(" First Time Setup");
Console.WriteLine("====================================");
Console.WriteLine();
Console.WriteLine("User Terms and Conditions:");
Console.WriteLine("====================================");
Console.WriteLine("1. This operating system is provided as-is without warranty");
Console.WriteLine("2. You are responsible for your data and backups");
Console.WriteLine("3. Unauthorized access attempts may be logged");
Console.WriteLine("4. System administrators have full access to all data");
Console.WriteLine("5. By using this system, you agree to these terms");
Console.WriteLine("6. Data privacy: Your personal data is stored locally");
Console.WriteLine("7. System updates may be installed automatically");
Console.WriteLine("8. No liability for data loss or corruption");
Console.WriteLine("9. Support available at: leonmmcoset@outlook.com");
Console.WriteLine("10. This license is for personal use only");
Console.WriteLine("====================================");
Console.WriteLine();
bool termsAccepted = false;
while (!termsAccepted)
{
Console.Write("Do you accept the User Terms? (yes/no): ");
string response = Console.ReadLine()?.ToLower();
if (response == "yes" || response == "y")
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.Clear();
var termsBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 18), "User Terms and Conditions", () => { }, true);
termsBox.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Gray, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.WriteLine("1. This operating system is provided as-is without warranty");
global::System.Console.SetCursorPosition(7, 8);
global::System.Console.WriteLine("2. You are responsible for your data and backups");
global::System.Console.SetCursorPosition(7, 9);
global::System.Console.WriteLine("3. Unauthorized access attempts may be logged");
global::System.Console.SetCursorPosition(7, 10);
global::System.Console.WriteLine("4. System administrators have full access to all data");
global::System.Console.SetCursorPosition(7, 11);
global::System.Console.WriteLine("5. By using this system, you agree to these terms");
global::System.Console.SetCursorPosition(7, 12);
global::System.Console.WriteLine("6. Data privacy: Your personal data is stored locally");
global::System.Console.SetCursorPosition(7, 13);
global::System.Console.WriteLine("7. System updates may be installed automatically");
global::System.Console.SetCursorPosition(7, 14);
global::System.Console.WriteLine("8. No liability for data loss or corruption");
global::System.Console.SetCursorPosition(7, 15);
global::System.Console.WriteLine("9. Support available at: https://lbbs.ecuil.com/#/thread/category/10");
global::System.Console.SetCursorPosition(7, 16);
global::System.Console.WriteLine("10. This license is for personal use only");
global::System.Console.SetCursorPosition(7, 17);
global::System.Console.WriteLine("11. Use of this OS requires recognition of the one-China principle");
bool termsAccepted = false;
while (!termsAccepted)
{
termsAccepted = true;
Console.WriteLine("Terms accepted.");
Console.WriteLine();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(5, 24);
global::System.Console.Write("Do you accept the User Terms? (yes/no): ");
string response = global::System.Console.ReadLine()?.ToLower();
if (response == "yes" || response == "y")
{
termsAccepted = true;
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(5, 24);
global::System.Console.Write("Terms accepted. ");
}
else if (response == "no" || response == "n")
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(5, 24);
global::System.Console.Write("You must accept the User Terms to continue.");
global::System.Threading.Thread.Sleep(2000);
Sys.Power.Reboot();
}
else
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(5, 24);
global::System.Console.Write("Invalid response. Please enter 'yes' or 'no'.");
}
}
else if (response == "no" || response == "n")
{
Console.WriteLine("You must accept the User Terms to continue.");
Console.WriteLine("Please restart the setup process.");
Thread.Sleep(2000);
Sys.Power.Reboot();
}
else
{
Console.WriteLine("Invalid response. Please enter 'yes' or 'no'.");
}
}
Console.WriteLine("Please set admin username and password:");
Console.Write("Username: ");
string username = Console.ReadLine();
while (string.IsNullOrWhiteSpace(username))
{
ShowError("Username cannot be empty.");
Console.Write("Username: ");
username = Console.ReadLine();
}
Console.WriteLine("Password: ");
string password = ReadPassword();
Console.WriteLine("Please confirm your password:");
string confirmPassword = ReadPassword();
while (password != confirmPassword)
{
ShowError("Passwords do not match. Please try again.");
Console.Write("Username: ");
username = Console.ReadLine();
global::System.Console.Clear();
var setupBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 12), "Admin Account Setup", () => { }, true);
setupBox.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Username: ");
string username = global::System.Console.ReadLine();
while (string.IsNullOrWhiteSpace(username))
{
ShowError("Username cannot be empty.");
Console.Write("Username: ");
username = Console.ReadLine();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Username cannot be empty. ");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Username: ");
username = global::System.Console.ReadLine();
}
Console.WriteLine("Password: ");
password = ReadPassword();
Console.WriteLine("Please confirm your password:");
confirmPassword = ReadPassword();
}
try
{
User adminUser = new User
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 8);
global::System.Console.Write("Password: ");
string password = ReadPassword();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 9);
global::System.Console.Write("Confirm Password: ");
string confirmPassword = ReadPassword();
while (password != confirmPassword)
{
Username = username,
Password = password,
IsAdmin = true
};
users.Add(adminUser);
SaveUsers();
ShowSuccess("Admin user created successfully!");
Console.WriteLine();
Console.WriteLine("Please set system hostname:");
Console.Write("Hostname: ");
string hostname = Console.ReadLine();
while (string.IsNullOrWhiteSpace(hostname))
{
ShowError("Hostname cannot be empty.");
Console.Write("Hostname: ");
hostname = Console.ReadLine();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Passwords do not match. Please try again. ");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Username: ");
username = global::System.Console.ReadLine();
while (string.IsNullOrWhiteSpace(username))
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Username cannot be empty. ");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Username: ");
username = global::System.Console.ReadLine();
}
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 8);
global::System.Console.Write("Password: ");
password = ReadPassword();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 9);
global::System.Console.Write("Confirm Password: ");
confirmPassword = ReadPassword();
}
if (users.Count > 0)
try
{
users[0].Hostname = hostname;
SaveHostname();
ShowSuccess($"Hostname set to: {hostname}");
User adminUser = new User
{
Username = username,
Password = password,
IsAdmin = true
};
users.Add(adminUser);
SaveUsers();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Admin user created successfully! ");
global::System.Console.Clear();
var hostnameBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 8), "Hostname Setup", () => { }, true);
hostnameBox.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Hostname: ");
string hostname = global::System.Console.ReadLine();
while (string.IsNullOrWhiteSpace(hostname))
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Hostname cannot be empty. ");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 7);
global::System.Console.Write("Hostname: ");
hostname = global::System.Console.ReadLine();
}
if (users.Count > 0)
{
users[0].Hostname = hostname;
SaveUsers();
}
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(7, 24);
global::System.Console.Write("Hostname set successfully! ");
global::System.Threading.Thread.Sleep(2000);
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.Clear();
global::System.Console.SetCursorPosition(30, 12);
global::System.Console.Write("Setup completed!");
global::System.Console.SetCursorPosition(20, 13);
global::System.Console.Write("System will restart in 3 seconds...");
global::System.Threading.Thread.Sleep(3000);
Sys.Power.Reboot();
}
Console.WriteLine();
Console.WriteLine("System will restart in 3 seconds...");
Console.WriteLine("Please wait...");
Console.WriteLine();
for (int i = 3; i > 0; i--)
catch (Exception ex)
{
Console.Write($"\rRestarting in {i} seconds... ");
Thread.Sleep(1000);
ShowError($"Error creating admin user: {ex.Message}");
}
Console.WriteLine("\rRestarting now!");
Sys.Power.Reboot();
}
catch (Exception ex)
{
ShowError($"Error creating admin user: {ex.Message}");
}
}
private void CreateUserFolder(string username)
@@ -469,129 +519,75 @@ namespace CMLeonOS
public bool Login()
{
Console.WriteLine("====================================");
Console.WriteLine(" System Login");
Console.WriteLine("====================================");
// Console.ReadKey(true);
// 检测ALT+Space按键
bool useFixMode = false;
ConsoleKeyInfo keyInfo;
try
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.Clear();
var loginBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(15, 8, 50, 10), "Login", () => { }, true);
loginBox.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(17, 10);
global::System.Console.Write("Username: ");
string username = global::System.Console.ReadLine();
if (string.IsNullOrWhiteSpace(username))
{
if (fixmode == true) {
keyInfo = Console.ReadKey(true);
if (keyInfo.Key == ConsoleKey.Spacebar && (keyInfo.Modifiers & ConsoleModifiers.Alt) != 0)
{
// 检测到ALT+Space进入修复模式
useFixMode = true;
Console.WriteLine();
Console.WriteLine("Fix Mode Activated");
Console.Write("Enter fix code: ");
string fixCode = "";
while (true)
{
var codeKey = Console.ReadKey(true);
if (codeKey.Key == ConsoleKey.Enter)
{
Console.WriteLine();
break;
}
else if (codeKey.Key == ConsoleKey.Backspace)
{
if (fixCode.Length > 0)
{
fixCode = fixCode.Substring(0, fixCode.Length - 1);
}
}
else
{
fixCode += codeKey.KeyChar;
Console.Write(codeKey.KeyChar);
}
}
if (fixCode == "FixMyComputer")
{
Console.WriteLine("Fix mode enabled!");
}
else
{
Console.WriteLine("Invalid fix code. Exiting fix mode.");
useFixMode = false;
}
}
}
else
{
// 正常登录流程
Console.Write("Username: ");
string username = Console.ReadLine();
if (string.IsNullOrWhiteSpace(username))
{
ShowError("Username cannot be empty.");
return false;
}
Console.Write("Password: ");
string password = ReadPassword();
// 查找用户
User foundUser = null;
foreach (User user in users)
{
if (user.Username.ToLower() == username.ToLower())
{
foundUser = user;
break;
}
}
if (foundUser == null)
{
ShowError("User not found.");
return false;
}
// 使用SHA256加密输入的密码后比较
string hashedInputPassword = HashPasswordSha256(password);
// Console.WriteLine($"Hashed Input Password: {hashedInputPassword}");
// Console.WriteLine($"Stored Password: {foundUser.Password}");
if (foundUser.Password != hashedInputPassword)
{
ShowError("Invalid password.");
return false;
}
ShowSuccess("Login successful!");
Console.Beep();
// 设置当前登录用户
currentLoggedInUser = foundUser;
// 创建用户文件夹
CreateUserFolder(foundUser.Username);
return true;
}
}
catch
{
// 如果读取按键失败,使用普通登录
ShowError("Error reading key input. Using normal login.");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(17, 24);
global::System.Console.Write("Username cannot be empty. ");
global::System.Threading.Thread.Sleep(1000);
return false;
}
// 如果使用了修复模式返回true
if (useFixMode)
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(17, 11);
global::System.Console.Write("Password: ");
string password = ReadPassword();
User foundUser = null;
foreach (User user in users)
{
return true;
if (user.Username.ToLower() == username.ToLower())
{
foundUser = user;
break;
}
}
return false;
if (foundUser == null)
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(17, 24);
global::System.Console.Write("User not found. ");
global::System.Threading.Thread.Sleep(1000);
return false;
}
string hashedInputPassword = HashPasswordSha256(password);
if (foundUser.Password != hashedInputPassword)
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(17, 24);
global::System.Console.Write("Invalid password. ");
global::System.Threading.Thread.Sleep(1000);
return false;
}
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(17, 24);
global::System.Console.Write("Login successful! ");
// global::System.Console.WriteLine("Please wait... ");
global::System.Threading.Thread.Sleep(1500);
global::System.Console.ResetColor();
global::System.Console.Clear();
global::System.Console.Beep();
currentLoggedInUser = foundUser;
CreateUserFolder(foundUser.Username);
return true;
}
public bool AddUser(string args, bool isAdmin)

1103
UI/Components.cs Normal file

File diff suppressed because it is too large Load Diff

303
UI/TUI.cs Normal file
View File

@@ -0,0 +1,303 @@
using System;
using System.Collections.Generic;
namespace CMLeonOS.UI
{
public struct Point
{
public int X { get; set; }
public int Y { get; set; }
public Point(int x, int y)
{
X = x;
Y = y;
}
public static Point operator +(Point a, Point b)
{
return new Point(a.X + b.X, a.Y + b.Y);
}
public static Point operator -(Point a, Point b)
{
return new Point(a.X - b.X, a.Y - b.Y);
}
}
public struct Size
{
public int Width { get; set; }
public int Height { get; set; }
public Size(int width, int height)
{
Width = width;
Height = height;
}
}
public struct Rect
{
public Point Position { get; set; }
public Size Size { get; set; }
public Rect(Point position, Size size)
{
Position = position;
Size = size;
}
public Rect(int x, int y, int width, int height)
{
Position = new Point(x, y);
Size = new Size(width, height);
}
public int Left => Position.X;
public int Top => Position.Y;
public int Right => Position.X + Size.Width;
public int Bottom => Position.Y + Size.Height;
public int Width => Size.Width;
public int Height => Size.Height;
public bool Contains(Point point)
{
return point.X >= Left && point.X < Right && point.Y >= Top && point.Y < Bottom;
}
}
public enum ConsoleColorEx
{
Black = ConsoleColor.Black,
DarkBlue = ConsoleColor.DarkBlue,
DarkGreen = ConsoleColor.DarkGreen,
DarkCyan = ConsoleColor.DarkCyan,
DarkRed = ConsoleColor.DarkRed,
DarkMagenta = ConsoleColor.DarkMagenta,
DarkYellow = ConsoleColor.DarkYellow,
Gray = ConsoleColor.Gray,
DarkGray = ConsoleColor.DarkGray,
Blue = ConsoleColor.Blue,
Green = ConsoleColor.Green,
Cyan = ConsoleColor.Cyan,
Red = ConsoleColor.Red,
Magenta = ConsoleColor.Magenta,
Yellow = ConsoleColor.Yellow,
White = ConsoleColor.White
}
public static class TUIHelper
{
public static int ConsoleWidth => 80;
public static int ConsoleHeight => 25;
public static void SetColors(ConsoleColor foreground, ConsoleColor background)
{
Console.ForegroundColor = foreground;
Console.BackgroundColor = background;
}
public static void ResetColors()
{
Console.ForegroundColor = ConsoleColor.White;
Console.BackgroundColor = ConsoleColor.Black;
}
public static void DrawBox(Rect rect, char horizontal = '-', char vertical = '|', char corner = '+', ConsoleColor? borderColor = null)
{
if (borderColor != null)
{
SetColors(borderColor.Value, ConsoleColor.Black);
}
for (int y = rect.Top; y < rect.Bottom; y++)
{
Console.SetCursorPosition(rect.Left, y);
if (y == rect.Top || y == rect.Bottom - 1)
{
Console.Write(corner);
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
{
Console.Write(horizontal);
}
Console.Write(corner);
}
else
{
Console.Write(vertical);
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
{
Console.Write(' ');
}
Console.Write(vertical);
}
}
ResetColors();
}
public static void DrawBox(Rect rect, string title, ConsoleColor? borderColor = null)
{
if (borderColor != null)
{
SetColors(borderColor.Value, ConsoleColor.Black);
}
char horizontal = '-';
char vertical = '|';
char corner = '+';
for (int y = rect.Top; y < rect.Bottom; y++)
{
Console.SetCursorPosition(rect.Left, y);
if (y == rect.Top)
{
Console.Write(corner);
// Calculate title position
int titleX = rect.Left + (rect.Width - title.Length) / 2;
int titleStart = titleX;
int titleEnd = titleX + title.Length;
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
{
// Skip drawing horizontal characters where title will be
if (!string.IsNullOrEmpty(title) && x >= titleStart && x < titleEnd)
{
Console.Write(' ');
}
else
{
Console.Write(horizontal);
}
}
Console.Write(corner);
}
else if (y == rect.Bottom - 1)
{
Console.Write(corner);
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
{
Console.Write(horizontal);
}
Console.Write(corner);
}
else
{
Console.Write(vertical);
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
{
Console.Write(' ');
}
Console.Write(vertical);
}
}
if (!string.IsNullOrEmpty(title))
{
int titleX = rect.Left + (rect.Width - title.Length) / 2;
Console.SetCursorPosition(titleX, rect.Top);
Console.Write(title);
}
ResetColors();
}
public static void DrawText(Point position, string text, ConsoleColor? color = null)
{
if (color != null)
{
SetColors(color.Value, ConsoleColor.Black);
}
Console.SetCursorPosition(position.X, position.Y);
Console.Write(text);
ResetColors();
}
public static void DrawCenteredText(int y, string text, ConsoleColor? color = null)
{
if (color != null)
{
SetColors(color.Value, ConsoleColor.Black);
}
int x = (ConsoleWidth - text.Length) / 2;
Console.SetCursorPosition(x, y);
Console.Write(text);
ResetColors();
}
public static void DrawHorizontalLine(int x, int y, int width, char c = '-', ConsoleColor? color = null)
{
if (color != null)
{
SetColors(color.Value, ConsoleColor.Black);
}
Console.SetCursorPosition(x, y);
Console.Write(new string(c, width));
ResetColors();
}
public static void DrawVerticalLine(int x, int y, int height, char c = '|', ConsoleColor? color = null)
{
if (color != null)
{
SetColors(color.Value, ConsoleColor.Black);
}
for (int i = 0; i < height; i++)
{
Console.SetCursorPosition(x, y + i);
Console.Write(c);
}
ResetColors();
}
public static void ClearArea(Rect rect)
{
for (int y = rect.Top; y < rect.Bottom; y++)
{
Console.SetCursorPosition(rect.Left, y);
Console.Write(new string(' ', rect.Width));
}
}
public static void SaveCursor()
{
Console.SetCursorPosition(Console.CursorLeft, Console.CursorTop);
}
public static void HideCursor()
{
Console.CursorVisible = false;
}
public static void ShowCursor()
{
Console.CursorVisible = true;
}
public static string TruncateText(string text, int maxLength)
{
if (text.Length <= maxLength)
{
return text;
}
return text.Substring(0, maxLength - 3) + "...";
}
public static string PadText(string text, int totalWidth, char padChar = ' ')
{
if (text.Length >= totalWidth)
{
return text;
}
return text + new string(padChar, totalWidth - text.Length);
}
}
}

332
UI/TUIDemo.cs Normal file
View File

@@ -0,0 +1,332 @@
using System;
using System.Threading;
using CMLeonOS.UI;
namespace CMLeonOS.UI.Examples
{
public static class TUIDemo
{
public static void Run()
{
Console.Clear();
Console.Title = "CMLeonOS TUI Library Demo";
bool running = true;
while (running)
{
ShowMainMenu();
}
}
private static void ShowMainMenu()
{
Console.Clear();
var menu = new Menu(new Rect(5, 5, 70, 15));
menu.Items.Add(new MenuItem("Button Demo", () => ShowButtonDemo()));
menu.Items.Add(new MenuItem("Input Box Demo", () => ShowInputBoxDemo()));
menu.Items.Add(new MenuItem("Dialog Demo", () => ShowDialogDemo()));
menu.Items.Add(new MenuItem("Progress Bar Demo", () => ShowProgressBarDemo()));
menu.Items.Add(new MenuItem("Tab Control Demo", () => ShowTabControlDemo()));
menu.Items.Add(new MenuItem("Exit", () => Environment.Exit(0)));
menu.Render();
bool menuRunning = true;
while (menuRunning)
{
var key = Console.ReadKey(true);
if (menu.HandleKey(key))
{
Thread.Sleep(100);
}
else if (key.Key == ConsoleKey.Escape)
{
menuRunning = false;
}
}
}
private static void ShowButtonDemo()
{
Console.Clear();
var titleBar = new Window(new Rect(0, 0, 80, 3), "Button Demo", () =>
{
Console.Clear();
ShowMainMenu();
}, false);
titleBar.Render();
var button1 = new Button(new Rect(10, 8, 20, 3), "Click Me!", ConsoleColor.Cyan, ConsoleColor.DarkBlue, ConsoleColor.White);
var button2 = new Button(new Rect(35, 8, 20, 3), "Disabled", ConsoleColor.Gray, ConsoleColor.Black, ConsoleColor.DarkGray);
button2.IsEnabled = false;
var button3 = new Button(new Rect(60, 8, 20, 3), "Hover Me", ConsoleColor.Yellow, ConsoleColor.DarkRed, ConsoleColor.White);
button1.Render();
button2.Render();
button3.Render();
var label = new Label(new Point(10, 13), "Button Component Examples:");
label.Render();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Press ENTER to click, ESC to return"));
statusBar.Render();
int focusedButton = 0;
button1.IsFocused = true;
bool demoRunning = true;
while (demoRunning)
{
var key = Console.ReadKey(true);
if (key.Key == ConsoleKey.Escape)
{
demoRunning = false;
}
else if (key.Key == ConsoleKey.Enter)
{
if (focusedButton == 0 && button1.IsEnabled)
{
Console.SetCursorPosition(10, 14);
Console.Write("Clicked!");
Thread.Sleep(1000);
}
}
else if (key.Key == ConsoleKey.LeftArrow)
{
button1.IsFocused = false;
button3.IsFocused = false;
focusedButton = (focusedButton - 1 + 3) % 3;
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
if (focusedButton == 2 && button2.IsEnabled) button2.IsFocused = true;
if (focusedButton == 1 && button3.IsEnabled) button3.IsFocused = true;
}
else if (key.Key == ConsoleKey.RightArrow)
{
button1.IsFocused = false;
button3.IsFocused = false;
focusedButton = (focusedButton + 1) % 3;
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
if (focusedButton == 2 && button2.IsEnabled) button2.IsFocused = true;
if (focusedButton == 1 && button3.IsEnabled) button3.IsFocused = true;
}
button1.Render();
button2.Render();
button3.Render();
}
}
private static void ShowInputBoxDemo()
{
Console.Clear();
var titleBar = new Window(new Rect(0, 0, 80, 3), "Input Box Demo", () =>
{
Console.Clear();
ShowMainMenu();
}, false);
titleBar.Render();
var inputBox = new InputBox(new Rect(20, 8, 40, 3), "Enter your name:", "John Doe", 20, false, ConsoleColor.White, ConsoleColor.Black, ConsoleColor.White);
inputBox.MaxLength = 20;
var button = new Button(new Rect(65, 8, 15, 3), "Submit");
button.OnClick = () =>
{
Console.SetCursorPosition(20, 12);
Console.Write($"Submitted: {inputBox.Value}");
Thread.Sleep(2000);
};
inputBox.Render();
button.Render();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Press ENTER to submit, ESC to return"));
statusBar.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = Console.ReadKey(true);
if (key.Key == ConsoleKey.Escape)
{
demoRunning = false;
}
else if (inputBox.HandleKey(key))
{
inputBox.Render();
}
else if (button.HandleKey(key))
{
button.Render();
}
}
}
private static void ShowDialogDemo()
{
Console.Clear();
var titleBar = new Window(new Rect(0, 0, 80, 3), "Dialog Demo", () =>
{
Console.Clear();
ShowMainMenu();
}, false);
titleBar.Render();
var dialog = new Dialog(new Rect(15, 5, 50, 7), "Confirm Action", "Are you sure you want to proceed?");
dialog.Buttons.Add(new Button(new Rect(17, 14, 12, 3), "Yes", ConsoleColor.White, ConsoleColor.DarkGreen, ConsoleColor.White));
dialog.Buttons[0].OnClick = () =>
{
Console.SetCursorPosition(15, 13);
Console.Write("Confirmed!");
Thread.Sleep(1500);
};
dialog.Buttons.Add(new Button(new Rect(31, 14, 12, 3), "No", ConsoleColor.White, ConsoleColor.DarkRed, ConsoleColor.White));
dialog.Buttons[1].OnClick = () =>
{
Console.SetCursorPosition(31, 13);
Console.Write("Cancelled!");
Thread.Sleep(1500);
};
dialog.Render();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to select, ENTER to choose"));
statusBar.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = Console.ReadKey(true);
if (key.Key == ConsoleKey.Escape)
{
demoRunning = false;
}
else if (dialog.HandleKey(key))
{
dialog.Render();
}
}
}
private static void ShowProgressBarDemo()
{
Console.Clear();
var titleBar = new Window(new Rect(0, 0, 80, 3), "Progress Bar Demo", () =>
{
Console.Clear();
ShowMainMenu();
}, false);
titleBar.Render();
var progressBar = new ProgressBar(new Point(15, 10), 50, 100);
progressBar.Value = 0;
var button = new Button(new Rect(35, 13, 15, 3), "Start");
button.OnClick = () =>
{
for (int i = 0; i <= 100; i++)
{
progressBar.SetValue(i);
progressBar.Render();
Thread.Sleep(30);
}
};
progressBar.Render();
button.Render();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Press ENTER to start, ESC to return"));
statusBar.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = Console.ReadKey(true);
if (key.Key == ConsoleKey.Escape)
{
demoRunning = false;
}
else if (button.HandleKey(key))
{
button.Render();
}
}
}
private static void ShowTabControlDemo()
{
Console.Clear();
var titleBar = new Window(new Rect(0, 0, 80, 3), "Tab Control Demo", () =>
{
Console.Clear();
ShowMainMenu();
}, false);
titleBar.Render();
var tabControl = new TabControl(new Rect(5, 5, 70, 15));
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 1", () =>
{
TUIHelper.SetColors(ConsoleColor.Cyan, ConsoleColor.Black);
Console.SetCursorPosition(10, 10);
Console.Write("Tab 1 Content");
TUIHelper.ResetColors();
}));
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 2", () =>
{
TUIHelper.SetColors(ConsoleColor.Green, ConsoleColor.Black);
Console.SetCursorPosition(10, 10);
Console.Write("Tab 2 Content");
TUIHelper.ResetColors();
}));
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 3", () =>
{
TUIHelper.SetColors(ConsoleColor.Magenta, ConsoleColor.Black);
Console.SetCursorPosition(10, 10);
Console.Write("Tab 3 Content");
TUIHelper.ResetColors();
}));
tabControl.Render();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to switch tabs, ESC to return"));
statusBar.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = Console.ReadKey(true);
if (key.Key == ConsoleKey.Escape)
{
demoRunning = false;
}
else if (tabControl.HandleKey(key))
{
tabControl.Render();
}
}
}
}
}

View File

@@ -33,11 +33,11 @@
</script>
<title>CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统它的目标是提供一个简单、可靠、安全的操作系统环境。">
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
<link rel="modulepreload" href="/assets/app-BITa06va.js"><link rel="modulepreload" href="/assets/404.html-B-2P5V78.js">
<link rel="prefetch" href="/assets/commands.html-CJdMGWM7.js" as="script"><link rel="prefetch" href="/assets/get-started.html-D_vM18Nz.js" as="script"><link rel="prefetch" href="/assets/lua.html-DxDsLuB0.js" as="script"><link rel="prefetch" href="/assets/index.html-DS7rXIvH.js" as="script">
<link rel="modulepreload" href="/assets/app-C1vKFkGc.js"><link rel="modulepreload" href="/assets/404.html-ByTdGTSm.js">
<link rel="prefetch" href="/assets/commands.html-DsR2axk8.js" as="script"><link rel="prefetch" href="/assets/get-started.html-CfHiKCXZ.js" as="script"><link rel="prefetch" href="/assets/lua.html-3_L4TJjQ.js" as="script"><link rel="prefetch" href="/assets/index.html-BMbDjf_W.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container" vp-container data-v-d32690b4><main class="page" data-v-d32690b4><div vp-content data-v-d32690b4><h1 data-v-d32690b4>404</h1><blockquote data-v-d32690b4>How did we get here?</blockquote><a class="route-link" href="/" data-v-d32690b4>Take me home</a></div></main></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-BITa06va.js" defer></script>
<div id="app"><!--[--><div class="vp-theme-container" vp-container data-v-d32690b4><main class="page" data-v-d32690b4><div vp-content data-v-d32690b4><h1 data-v-d32690b4>404</h1><blockquote data-v-d32690b4>There&#39;s nothing here.</blockquote><a class="route-link" href="/" data-v-d32690b4>Take me home</a></div></main></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C1vKFkGc.js" defer></script>
</body>
</html>

View File

@@ -1 +1 @@
import{_ as e,c as o,b as a,o as n}from"./app-BITa06va.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data};
import{_ as e,c as o,b as a,o as n}from"./app-C1vKFkGc.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data};

View File

@@ -0,0 +1 @@
import{_ as t,c as a,a as s,o as l}from"./app-C1vKFkGc.js";const o={};function n(i,e){return l(),a("div",null,[...e[0]||(e[0]=[s('<h1 id="配置教程" tabindex="-1"><a class="header-anchor" href="#配置教程"><span>配置教程</span></a></h1><h2 id="准备工作" tabindex="-1"><a class="header-anchor" href="#准备工作"><span>准备工作</span></a></h2><p>首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:</p><ul><li>处理器:一核以上</li><li>内存512MB以上</li><li>硬盘512MB以上</li><li>一个键盘</li><li>一个蜂鸣器或音频输出设备</li><li>建议装上AMD驱动的网卡Intel驱动的网卡似乎无法运行</li></ul><h2 id="配置硬盘" tabindex="-1"><a class="header-anchor" href="#配置硬盘"><span>配置硬盘</span></a></h2><blockquote><p>注:在准备发布的 1.0.0 PreRelease 2 版本中,不需要再执行这一步骤。 系统会在启动时自动检测硬盘是否格式化,如果未格式化,会提示用户并自动格式化硬盘。</p></blockquote><p>使用PE或其它工具格式化硬盘注意只分一个区文件系统选择FAT32</p><h2 id="安装cmleonos" tabindex="-1"><a class="header-anchor" href="#安装cmleonos"><span>安装CMLeonOS</span></a></h2><p>将CMLeonOS的ISO文件挂载到虚拟机或实体机上启动后按照提示进行 First time setup。</p><p>在 First time setup 中系统会让你配置用户名、密码、主机名配置完后会进行重启重启之后正常登陆系统然后就可以开始使用CMLeonOS了。</p>',10)])])}const m=t(o,[["render",n]]),r=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770548716000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"ce90efeb3e81e83c7cfb468685933c2eabadf789","time":1770548716000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"文档更新"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"get-started.md"}');export{m as comp,r as data};

View File

@@ -1 +0,0 @@
import{_ as t,c as a,a as l,o as s}from"./app-BITa06va.js";const n={};function i(o,e){return s(),a("div",null,[...e[0]||(e[0]=[l('<h1 id="配置教程" tabindex="-1"><a class="header-anchor" href="#配置教程"><span>配置教程</span></a></h1><h2 id="准备工作" tabindex="-1"><a class="header-anchor" href="#准备工作"><span>准备工作</span></a></h2><p>首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:</p><ul><li>处理器:一核以上</li><li>内存512MB以上</li><li>硬盘512MB以上</li><li>一个键盘</li><li>一个蜂鸣器或音频输出设备</li><li>建议装上AMD驱动的网卡Intel驱动的网卡似乎无法运行</li></ul><h2 id="配置硬盘" tabindex="-1"><a class="header-anchor" href="#配置硬盘"><span>配置硬盘</span></a></h2><p>使用PE或其它工具格式化硬盘注意只分一个区文件系统选择FAT32</p><h2 id="安装cmleonos" tabindex="-1"><a class="header-anchor" href="#安装cmleonos"><span>安装CMLeonOS</span></a></h2><p>将CMLeonOS的ISO文件挂载到虚拟机或实体机上启动后按照提示进行 First time setup。</p><p>在 First time setup 中系统会让你配置用户名、密码、主机名配置完后会进行重启重启之后正常登陆系统然后就可以开始使用CMLeonOS了。</p>',9)])])}const r=t(n,[["render",i]]),m=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770190333000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":1,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"get-started.md"}');export{r as comp,m as data};

View File

@@ -1 +1 @@
import{_ as e,c as t,o as a}from"./app-BITa06va.js";const o={};function m(s,i){return a(),t("div")}const c=e(o,[["render",m]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"},{"text":"命令列表","link":"/commands.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储用户可以将文件持久存储在硬盘中。"},{"title":"命令别名","details":"CMLeonOS支持命令别名功能用户可以创建自定义命令快捷方式。"}]},"headers":[],"git":{"updatedTime":1770300033000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"4384578fdb936483c76ffe61512a6530b54cf9ce","time":1770300033000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"update"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data};
import{_ as e,c as t,o as a}from"./app-C1vKFkGc.js";const o={};function m(s,i){return a(),t("div")}const c=e(o,[["render",m]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"},{"text":"命令列表","link":"/commands.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储用户可以将文件持久存储在硬盘中。"},{"title":"命令别名","details":"CMLeonOS支持命令别名功能用户可以创建自定义命令快捷方式。"}]},"headers":[],"git":{"updatedTime":1770300033000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"4384578fdb936483c76ffe61512a6530b54cf9ce","time":1770300033000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"update"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data};

View File

@@ -33,8 +33,8 @@
</script>
<title>命令列表 | CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统它的目标是提供一个简单、可靠、安全的操作系统环境。">
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
<link rel="modulepreload" href="/assets/app-BITa06va.js"><link rel="modulepreload" href="/assets/commands.html-CJdMGWM7.js">
<link rel="prefetch" href="/assets/get-started.html-D_vM18Nz.js" as="script"><link rel="prefetch" href="/assets/lua.html-DxDsLuB0.js" as="script"><link rel="prefetch" href="/assets/index.html-DS7rXIvH.js" as="script"><link rel="prefetch" href="/assets/404.html-B-2P5V78.js" as="script">
<link rel="modulepreload" href="/assets/app-C1vKFkGc.js"><link rel="modulepreload" href="/assets/commands.html-DsR2axk8.js">
<link rel="prefetch" href="/assets/get-started.html-CfHiKCXZ.js" as="script"><link rel="prefetch" href="/assets/lua.html-3_L4TJjQ.js" as="script"><link rel="prefetch" href="/assets/index.html-BMbDjf_W.js" as="script"><link rel="prefetch" href="/assets/404.html-ByTdGTSm.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">CMLeonOS官方文档站</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><p tabindex="0" class="vp-sidebar-item vp-sidebar-heading">命令列表 <!----></p><!----></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div><h1 id="命令列表" tabindex="-1"><a class="header-anchor" href="#命令列表"><span>命令列表</span></a></h1><p>CMLeonOS 提供了丰富的命令行工具,以下是所有可用命令的详细说明。</p><h2 id="系统命令" tabindex="-1"><a class="header-anchor" href="#系统命令"><span>系统命令</span></a></h2><h3 id="echo" tabindex="-1"><a class="header-anchor" href="#echo"><span>echo</span></a></h3><p>输出文本到控制台。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">echo</span> <span class="token operator">&lt;</span>text<span class="token operator">&gt;</span></span>
@@ -143,7 +143,17 @@
<span class="line">base64 decode <span class="token operator">&lt;</span>text<span class="token operator">&gt;</span> <span class="token comment"># 解码</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">base64 encode <span class="token string">&quot;Hello World&quot;</span></span>
<span class="line">base64 decode <span class="token string">&quot;SGVsbG8gV29ybGQ=&quot;</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="alias" tabindex="-1"><a class="header-anchor" href="#alias"><span>alias</span></a></h3><p>创建命令别名</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">alias</span> <span class="token comment"># 列出所有别名</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="matrix" tabindex="-1"><a class="header-anchor" href="#matrix"><span>matrix</span></a></h3><p>显示黑客帝国矩阵效果</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">matrix</span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>说明:</strong></p><ul><li>显示《黑客帝国》风格的矩阵雨效果</li><li>绿色字符在黑色背景上显示</li><li>随机字符和下落速度</li><li>按 ESC 或 Q 键退出</li></ul><h3 id="app" tabindex="-1"><a class="header-anchor" href="#app"><span>app</span></a></h3><p>应用程序管理器。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">app list <span class="token comment"># 列出所有可用应用</span></span>
<span class="line">app <span class="token function">install</span> <span class="token operator">&lt;</span>name<span class="token operator">&gt;</span> <span class="token comment"># 安装应用</span></span>
<span class="line">app uninstall <span class="token operator">&lt;</span>name<span class="token operator">&gt;</span> <span class="token comment"># 卸载应用</span></span>
<span class="line">app installed <span class="token comment"># 列出已安装应用</span></span>
<span class="line">app <span class="token builtin class-name">help</span> <span class="token comment"># 显示帮助信息</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">app list</span>
<span class="line">app <span class="token function">install</span> helloworld.lua</span>
<span class="line">app uninstall helloworld.lua</span>
<span class="line">app installed</span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>说明:</strong></p><ul><li>应用存储在嵌入资源中</li><li>安装的应用保存在 <code>0:\apps</code> 目录</li><li>安装的应用可以使用 <code>lua</code> 命令运行</li></ul><h3 id="alias" tabindex="-1"><a class="header-anchor" href="#alias"><span>alias</span></a></h3><p>创建命令别名。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">alias</span> <span class="token comment"># 列出所有别名</span></span>
<span class="line"><span class="token builtin class-name">alias</span> <span class="token operator">&lt;</span>name<span class="token operator">&gt;</span> <span class="token operator">&lt;</span>command<span class="token operator">&gt;</span> <span class="token comment"># 创建新别名</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">alias</span> ll <span class="token string">&#39;ls -l&#39;</span></span>
<span class="line"><span class="token builtin class-name">alias</span> home <span class="token string">&#39;cd /home&#39;</span></span>
@@ -179,7 +189,7 @@
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token function">env</span></span>
<span class="line"><span class="token function">env</span> <span class="token environment constant">PATH</span></span>
<span class="line"><span class="token function">env</span> MYVAR hello</span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li>所有命令不区分大小写</li><li>使用 <code>help</code> 命令可以查看所有可用命令</li><li>使用 <code>help &lt;command&gt;</code> 可以查看特定命令的详细帮助</li><li>文件路径使用反斜杠 <code>\</code> 或正斜杠 <code>/</code> 均可</li><li>支持相对路径和绝对路径</li></ol></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-06T08:18:30.000Z" data-allow-mismatch>2026/2/6 16:18</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-BITa06va.js" defer></script>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li>所有命令不区分大小写</li><li>使用 <code>help</code> 命令可以查看所有可用命令</li><li>使用 <code>help &lt;command&gt;</code> 可以查看特定命令的详细帮助</li><li>文件路径使用反斜杠 <code>\</code> 或正斜杠 <code>/</code> 均可</li><li>支持相对路径和绝对路径</li></ol></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-06T09:30:12.000Z" data-allow-mismatch>2026/2/6 17:30</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C1vKFkGc.js" defer></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -33,8 +33,8 @@
</script>
<title>CMLeonOS Lua API 文档 | CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统它的目标是提供一个简单、可靠、安全的操作系统环境。">
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
<link rel="modulepreload" href="/assets/app-BITa06va.js"><link rel="modulepreload" href="/assets/lua.html-DxDsLuB0.js">
<link rel="prefetch" href="/assets/commands.html-CJdMGWM7.js" as="script"><link rel="prefetch" href="/assets/get-started.html-D_vM18Nz.js" as="script"><link rel="prefetch" href="/assets/index.html-DS7rXIvH.js" as="script"><link rel="prefetch" href="/assets/404.html-B-2P5V78.js" as="script">
<link rel="modulepreload" href="/assets/app-C1vKFkGc.js"><link rel="modulepreload" href="/assets/lua.html-3_L4TJjQ.js">
<link rel="prefetch" href="/assets/commands.html-DsR2axk8.js" as="script"><link rel="prefetch" href="/assets/get-started.html-CfHiKCXZ.js" as="script"><link rel="prefetch" href="/assets/index.html-BMbDjf_W.js" as="script"><link rel="prefetch" href="/assets/404.html-ByTdGTSm.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">CMLeonOS官方文档站</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><p tabindex="0" class="vp-sidebar-item vp-sidebar-heading">CMLeonOS Lua API 文档 <!----></p><!----></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div><h1 id="cmleonos-lua-api-文档" tabindex="-1"><a class="header-anchor" href="#cmleonos-lua-api-文档"><span>CMLeonOS Lua API 文档</span></a></h1><p>本文档记录了 CMLeonOS 中 Lua 支持的所有函数和库。</p><h2 id="基础库-base" tabindex="-1"><a class="header-anchor" href="#基础库-base"><span>基础库 (base)</span></a></h2><h3 id="assert-v-message" tabindex="-1"><a class="header-anchor" href="#assert-v-message"><span>assert(v [, message])</span></a></h3><p>如果 v 为 false 或 nil则抛出错误。可选参数 message 为错误信息。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token function">assert</span><span class="token punctuation">(</span><span class="token keyword">true</span><span class="token punctuation">,</span> <span class="token string">&quot;This should be true&quot;</span><span class="token punctuation">)</span></span>
@@ -205,7 +205,13 @@
<span class="line"><span class="token keyword">end</span></span>
<span class="line"><span class="token keyword">local</span> elapsed <span class="token operator">=</span> os<span class="token punctuation">.</span><span class="token function">timerstop</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Elapsed time:&quot;</span><span class="token punctuation">,</span> elapsed<span class="token punctuation">,</span> <span class="token string">&quot;seconds&quot;</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>注意</strong></p><ul><li>如果在未调用 <code>timerstart</code> 的情况下调用 <code>timerstop</code>,将返回 <code>nil</code></li><li>每次调用 <code>timerstop</code> 后,计时器会被重置</li><li>返回的时间单位为秒(浮点数)</li></ul><hr><h2 id="输入输出库-io" tabindex="-1"><a class="header-anchor" href="#输入输出库-io"><span>输入输出库 (io)</span></a></h2><h3 id="io-close-file" tabindex="-1"><a class="header-anchor" href="#io-close-file"><span>io.close(file)</span></a></h3><p>关闭文件。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token keyword">local</span> file <span class="token operator">=</span> io<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span><span class="token string">&quot;test.txt&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;w&quot;</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>注意</strong></p><ul><li>如果在未调用 <code>timerstart</code> 的情况下调用 <code>timerstop</code>,将返回 <code>nil</code></li><li>每次调用 <code>timerstop</code> 后,计时器会被重置</li><li>返回的时间单位为秒(浮点数)</li></ul><h3 id="os-tui-drawbox-x-y-width-height-title-bordercolor-backgroundcolor" tabindex="-1"><a class="header-anchor" href="#os-tui-drawbox-x-y-width-height-title-bordercolor-backgroundcolor"><span>os.tui_drawbox(x, y, width, height, title, borderColor, backgroundColor)</span></a></h3><p>绘制带边框和标题的矩形框。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_drawbox</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token string">&quot;Title&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;white&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;darkblue&quot;</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong></p><ul><li><code>x</code> - 矩形框的左上角 X 坐标</li><li><code>y</code> - 矩形框的左上角 Y 坐标</li><li><code>width</code> - 矩形框的宽度</li><li><code>height</code> - 矩形框的高度</li><li><code>title</code> - 矩形框的标题(可选)</li><li><code>borderColor</code> - 边框颜色black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow</li><li><code>backgroundColor</code> - 背景颜色(同上)</li></ul><h3 id="os-tui-drawtext-x-y-text-foregroundcolor-backgroundcolor" tabindex="-1"><a class="header-anchor" href="#os-tui-drawtext-x-y-text-foregroundcolor-backgroundcolor"><span>os.tui_drawtext(x, y, text, foregroundColor, backgroundColor)</span></a></h3><p>在指定位置绘制文本。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_drawtext</span><span class="token punctuation">(</span><span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">,</span> <span class="token string">&quot;Hello World!&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;yellow&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;black&quot;</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong></p><ul><li><code>x</code> - 文本的 X 坐标</li><li><code>y</code> - 文本的 Y 坐标</li><li><code>text</code> - 要绘制的文本内容</li><li><code>foregroundColor</code> - 前景色(同上)</li><li><code>backgroundColor</code> - 背景色(同上)</li></ul><h3 id="os-tui-setcolor-foregroundcolor-backgroundcolor" tabindex="-1"><a class="header-anchor" href="#os-tui-setcolor-foregroundcolor-backgroundcolor"><span>os.tui_setcolor(foregroundColor, backgroundColor)</span></a></h3><p>设置前景色和背景色。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_setcolor</span><span class="token punctuation">(</span><span class="token string">&quot;white&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;black&quot;</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong></p><ul><li><code>foregroundColor</code> - 前景色black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow</li><li><code>backgroundColor</code> - 背景色(同上)</li></ul><h3 id="os-tui-setcursor-x-y" tabindex="-1"><a class="header-anchor" href="#os-tui-setcursor-x-y"><span>os.tui_setcursor(x, y)</span></a></h3><p>设置光标位置。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_setcursor</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong></p><ul><li><code>x</code> - 光标的 X 坐标</li><li><code>y</code> - 光标的 Y 坐标</li></ul><h3 id="os-tui-clear" tabindex="-1"><a class="header-anchor" href="#os-tui-clear"><span>os.tui_clear()</span></a></h3><p>清屏。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h3 id="os-tui-drawline-x-y-length-character-color" tabindex="-1"><a class="header-anchor" href="#os-tui-drawline-x-y-length-character-color"><span>os.tui_drawline(x, y, length, character, color)</span></a></h3><p>绘制水平线。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_drawline</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token string">&quot;-&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;green&quot;</span><span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong></p><ul><li><code>x</code> - 线的起始 X 坐标</li><li><code>y</code> - 线的起始 Y 坐标</li><li><code>length</code> - 线的长度</li><li><code>character</code> - 用于绘制线的字符</li><li><code>color</code> - 线的颜色(同上)</li></ul><hr><h2 id="输入输出库-io" tabindex="-1"><a class="header-anchor" href="#输入输出库-io"><span>输入输出库 (io)</span></a></h2><h3 id="io-close-file" tabindex="-1"><a class="header-anchor" href="#io-close-file"><span>io.close(file)</span></a></h3><p>关闭文件。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token keyword">local</span> file <span class="token operator">=</span> io<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span><span class="token string">&quot;test.txt&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;w&quot;</span><span class="token punctuation">)</span></span>
<span class="line">file<span class="token punctuation">:</span><span class="token function">write</span><span class="token punctuation">(</span><span class="token string">&quot;Hello&quot;</span><span class="token punctuation">)</span></span>
<span class="line">io<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span>file<span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="io-flush" tabindex="-1"><a class="header-anchor" href="#io-flush"><span>io.flush()</span></a></h3><p>刷新所有打开文件的输出缓冲区。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">io<span class="token punctuation">.</span><span class="token function">flush</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
@@ -333,7 +339,7 @@
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Hash:&quot;</span><span class="token punctuation">,</span> hash<span class="token punctuation">)</span></span>
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Encoded:&quot;</span><span class="token punctuation">,</span> encoded<span class="token punctuation">)</span></span>
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Decoded:&quot;</span><span class="token punctuation">,</span> decoded<span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li><strong>交互模式</strong>:使用 <code>lua --shell</code> 进入交互式 Lua Shell</li><li><strong>错误处理</strong>:所有 Lua 执行错误都会被捕获并显示</li><li><strong>系统函数</strong><code>os</code> 库包含 CMLeonOS 特定的系统函数</li><li><strong>加密支持</strong>:支持 SHA256 和 Base64 编码/解码</li><li><strong>标准 Lua</strong>:完全兼容 Lua 5.1 标准</li></ol><h2 id="版本信息" tabindex="-1"><a class="header-anchor" href="#版本信息"><span>版本信息</span></a></h2><ul><li><strong>Lua 版本</strong>5.2</li><li><strong>CMLeonOS 版本</strong>:最新</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-05T05:15:17.000Z" data-allow-mismatch>2026/2/5 13:15</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-BITa06va.js" defer></script>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li><strong>交互模式</strong>:使用 <code>lua --shell</code> 进入交互式 Lua Shell</li><li><strong>错误处理</strong>:所有 Lua 执行错误都会被捕获并显示</li><li><strong>系统函数</strong><code>os</code> 库包含 CMLeonOS 特定的系统函数</li><li><strong>加密支持</strong>:支持 SHA256 和 Base64 编码/解码</li><li><strong>标准 Lua</strong>:完全兼容 Lua 5.1 标准</li></ol><h2 id="版本信息" tabindex="-1"><a class="header-anchor" href="#版本信息"><span>版本信息</span></a></h2><ul><li><strong>Lua 版本</strong>5.2</li><li><strong>CMLeonOS 版本</strong>:最新</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-07T10:54:10.000Z" data-allow-mismatch>2026/2/7 18:54</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C1vKFkGc.js" defer></script>
</body>
</html>

View File

@@ -613,6 +613,45 @@ base64 encode "Hello World"
base64 decode "SGVsbG8gV29ybGQ="
```
### matrix
显示黑客帝国矩阵效果。
**用法:**
```bash
matrix
```
**说明:**
- 显示《黑客帝国》风格的矩阵雨效果
- 绿色字符在黑色背景上显示
- 随机字符和下落速度
- 按 ESC 或 Q 键退出
### app
应用程序管理器。
**用法:**
```bash
app list # 列出所有可用应用
app install <name> # 安装应用
app uninstall <name> # 卸载应用
app installed # 列出已安装应用
app help # 显示帮助信息
```
**示例:**
```bash
app list
app install helloworld.lua
app uninstall helloworld.lua
app installed
```
**说明:**
- 应用存储在嵌入资源中
- 安装的应用保存在 `0:\apps` 目录
- 安装的应用可以使用 `lua` 命令运行
### alias
创建命令别名。
@@ -778,6 +817,23 @@ labyrinth
- 出口位置用红色 E 表示
- 迷宫使用递归回溯算法随机生成
### snake
玩贪吃蛇游戏。
**用法:**
```bash
snake
```
**说明:**
- 使用方向键 (↑ ↓ ← →) 控制蛇的移动
- 按 ESC 或 Q 键退出游戏
- 蛇身用绿色 ■ 表示
- 食物用红色 ● 表示
- 吃到食物得分 +10 分
- 撞到墙壁或自己身体游戏结束
- 游戏区域40x20 字符
### diff
比较两个文件的差异。

View File

@@ -9,6 +9,9 @@
- 建议装上AMD驱动的网卡Intel驱动的网卡似乎无法运行
## 配置硬盘
> 注:在准备发布的 1.0.0 PreRelease 2 版本中,不需要再执行这一步骤。
> 系统会在启动时自动检测硬盘是否格式化,如果未格式化,会提示用户并自动格式化硬盘。
使用PE或其它工具格式化硬盘注意只分一个区文件系统选择FAT32
## 安装CMLeonOS

View File

@@ -721,6 +721,79 @@ print("Elapsed time:", elapsed, "seconds")
- 每次调用 `timerstop` 后,计时器会被重置
- 返回的时间单位为秒(浮点数)
### os.tui_drawbox(x, y, width, height, title, borderColor, backgroundColor)
绘制带边框和标题的矩形框。
```lua
os.tui_drawbox(10, 5, 40, 10, "Title", "white", "darkblue")
```
**参数**
- `x` - 矩形框的左上角 X 坐标
- `y` - 矩形框的左上角 Y 坐标
- `width` - 矩形框的宽度
- `height` - 矩形框的高度
- `title` - 矩形框的标题(可选)
- `borderColor` - 边框颜色black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow
- `backgroundColor` - 背景颜色(同上)
### os.tui_drawtext(x, y, text, foregroundColor, backgroundColor)
在指定位置绘制文本。
```lua
os.tui_drawtext(15, 8, "Hello World!", "yellow", "black")
```
**参数**
- `x` - 文本的 X 坐标
- `y` - 文本的 Y 坐标
- `text` - 要绘制的文本内容
- `foregroundColor` - 前景色(同上)
- `backgroundColor` - 背景色(同上)
### os.tui_setcolor(foregroundColor, backgroundColor)
设置前景色和背景色。
```lua
os.tui_setcolor("white", "black")
```
**参数**
- `foregroundColor` - 前景色black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow
- `backgroundColor` - 背景色(同上)
### os.tui_setcursor(x, y)
设置光标位置。
```lua
os.tui_setcursor(20, 10)
```
**参数**
- `x` - 光标的 X 坐标
- `y` - 光标的 Y 坐标
### os.tui_clear()
清屏。
```lua
os.tui_clear()
```
### os.tui_drawline(x, y, length, character, color)
绘制水平线。
```lua
os.tui_drawline(10, 15, 30, "-", "green")
```
**参数**
- `x` - 线的起始 X 坐标
- `y` - 线的起始 Y 坐标
- `length` - 线的长度
- `character` - 用于绘制线的字符
- `color` - 线的颜色(同上)
---
## 输入输出库 (io)

BIN
font.psf Normal file

Binary file not shown.

View File

@@ -4,6 +4,7 @@ namespace UniLua
using System.Diagnostics;
using System;
using CMLeonOS;
using CMLeonOS.UI;
using Sys = Cosmos.System;
using System.Threading;
@@ -38,10 +39,17 @@ namespace UniLua
new NameFuncPair("base64decrypt", OS_Base64Decrypt),
new NameFuncPair("timerstart", OS_TimerStart),
new NameFuncPair("timerstop", OS_TimerStop),
new NameFuncPair("tui_drawbox", OS_TUIDrawBox),
new NameFuncPair("tui_drawtext", OS_TUIDrawText),
new NameFuncPair("tui_setcolor", OS_TUISetColor),
new NameFuncPair("tui_setcursor", OS_TUISetCursor),
new NameFuncPair("tui_clear", OS_TUIClear),
new NameFuncPair("tui_drawline", OS_TUIDrawLine),
#endif
};
lua.L_NewLib( define );
return 1;
}
@@ -231,6 +239,118 @@ namespace UniLua
_timerStartTime = null;
return 1;
}
private static int OS_TUIDrawBox(ILuaState lua)
{
int x = (int)lua.L_CheckNumber(1);
int y = (int)lua.L_CheckNumber(2);
int width = (int)lua.L_CheckNumber(3);
int height = (int)lua.L_CheckNumber(4);
string title = lua.L_CheckString(5);
string borderColor = lua.L_CheckString(6);
string backgroundColor = lua.L_CheckString(7);
ConsoleColor borderColorEnum = ParseColor(borderColor);
ConsoleColor backgroundColorEnum = ParseColor(backgroundColor);
var rect = new Rect(x, y, width, height);
TUIHelper.SetColors(borderColorEnum, backgroundColorEnum);
TUIHelper.DrawBox(rect, title, borderColorEnum);
lua.PushBoolean(true);
return 1;
}
private static int OS_TUIDrawText(ILuaState lua)
{
int x = (int)lua.L_CheckNumber(1);
int y = (int)lua.L_CheckNumber(2);
string text = lua.L_CheckString(3);
string foregroundColor = lua.L_CheckString(4);
string backgroundColor = lua.L_CheckString(5);
ConsoleColor foregroundColorEnum = ParseColor(foregroundColor);
ConsoleColor backgroundColorEnum = ParseColor(backgroundColor);
TUIHelper.SetColors(foregroundColorEnum, backgroundColorEnum);
Console.SetCursorPosition(x, y);
Console.Write(text);
lua.PushBoolean(true);
return 1;
}
private static int OS_TUISetColor(ILuaState lua)
{
string foregroundColor = lua.L_CheckString(1);
string backgroundColor = lua.L_CheckString(2);
ConsoleColor foregroundColorEnum = ParseColor(foregroundColor);
ConsoleColor backgroundColorEnum = ParseColor(backgroundColor);
TUIHelper.SetColors(foregroundColorEnum, backgroundColorEnum);
lua.PushBoolean(true);
return 1;
}
private static int OS_TUISetCursor(ILuaState lua)
{
int x = (int)lua.L_CheckNumber(1);
int y = (int)lua.L_CheckNumber(2);
Console.SetCursorPosition(x, y);
lua.PushBoolean(true);
return 1;
}
private static int OS_TUIClear(ILuaState lua)
{
Console.Clear();
lua.PushBoolean(true);
return 1;
}
private static int OS_TUIDrawLine(ILuaState lua)
{
int x = (int)lua.L_CheckNumber(1);
int y = (int)lua.L_CheckNumber(2);
int length = (int)lua.L_CheckNumber(3);
char character = lua.L_CheckString(4)[0];
string color = lua.L_CheckString(5);
ConsoleColor colorEnum = ParseColor(color);
TUIHelper.SetColors(colorEnum, ConsoleColor.Black);
Console.SetCursorPosition(x, y);
for (int i = 0; i < length; i++)
{
Console.Write(character);
}
lua.PushBoolean(true);
return 1;
}
private static ConsoleColor ParseColor(string colorName)
{
switch (colorName.ToLower())
{
case "black": return ConsoleColor.Black;
case "blue": return ConsoleColor.Blue;
case "cyan": return ConsoleColor.Cyan;
case "darkblue": return ConsoleColor.DarkBlue;
case "darkcyan": return ConsoleColor.DarkCyan;
case "darkgray": return ConsoleColor.DarkGray;
case "darkgreen": return ConsoleColor.DarkGreen;
case "darkmagenta": return ConsoleColor.DarkMagenta;
case "darkred": return ConsoleColor.DarkRed;
case "darkyellow": return ConsoleColor.DarkYellow;
case "gray": return ConsoleColor.Gray;
case "green": return ConsoleColor.Green;
case "magenta": return ConsoleColor.Magenta;
case "red": return ConsoleColor.Red;
case "white": return ConsoleColor.White;
case "yellow": return ConsoleColor.Yellow;
default: return ConsoleColor.White;
}
}
#endif
}
}

View File

@@ -34,6 +34,9 @@ namespace CMLeonOS.shell
case "calc":
shell.Calculate(args);
break;
case "calcgui":
shell.ShowCalculatorGUI();
break;
case "history":
shell.ShowHistory();
break;
@@ -49,6 +52,12 @@ namespace CMLeonOS.shell
case "nano":
shell.NanoFile(args);
break;
case "matrix":
shell.ShowMatrix();
break;
case "app":
shell.ProcessApp(args);
break;
case "diff":
shell.DiffFiles(args);
break;
@@ -190,9 +199,15 @@ namespace CMLeonOS.shell
case "testgui":
shell.ProcessTestGui();
break;
case "testtui":
shell.ProcessTestTUI();
break;
case "labyrinth":
shell.ProcessLabyrinth();
break;
case "snake":
shell.PlaySnake();
break;
case "alias":
shell.ProcessAlias(args);
break;

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CMLeonOS;
namespace CMLeonOS.Commands.Environment
{
@@ -11,7 +13,41 @@ namespace CMLeonOS.Commands.Environment
if (parts.Length == 0)
{
envManager.ListVariables();
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "list",
Description = "List all environment variables",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "see <varname>",
Description = "View environment variable value",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "add <varname> <value>",
Description = "Add environment variable",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "change <varname> <value>",
Description = "Change environment variable",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "delete <varname>",
Description = "Delete environment variable",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("env", commandInfos));
return;
}
@@ -39,7 +75,7 @@ namespace CMLeonOS.Commands.Environment
else
{
showError("Error: Please specify variable name");
showError("Usage: env see <varname>");
showError(UsageGenerator.GenerateSimpleUsage("env", "see <varname>"));
}
break;
case "add":
@@ -60,7 +96,7 @@ namespace CMLeonOS.Commands.Environment
else
{
showError("Error: Please specify variable name and value");
showError("Usage: env add <varname> <value>");
showError(UsageGenerator.GenerateSimpleUsage("env", "add <varname> <value>"));
}
break;
case "change":
@@ -81,7 +117,7 @@ namespace CMLeonOS.Commands.Environment
else
{
showError("Error: Please specify variable name and value");
showError("Usage: env change <varname> <value>");
showError(UsageGenerator.GenerateSimpleUsage("env", "change <varname> <value>"));
}
break;
case "delete":
@@ -101,12 +137,46 @@ namespace CMLeonOS.Commands.Environment
else
{
showError("Error: Please specify variable name");
showError("Usage: env delete <varname>");
showError(UsageGenerator.GenerateSimpleUsage("env", "delete <varname>"));
}
break;
default:
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "list",
Description = "List all environment variables",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "see <varname>",
Description = "View environment variable value",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "add <varname> <value>",
Description = "Add environment variable",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "change <varname> <value>",
Description = "Change environment variable",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "delete <varname>",
Description = "Delete environment variable",
IsOptional = false
}
};
showError("Error: Invalid env command");
showError("Usage: env [list] | env see <varname> | env add <varname> <value> | env change <varname> <value> | env delete <varname>");
showError(UsageGenerator.GenerateUsage("env", commandInfos));
break;
}
}

View File

@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using CMLeonOS;
namespace CMLeonOS.Commands.FileSystem
{
@@ -8,7 +10,24 @@ namespace CMLeonOS.Commands.FileSystem
{
if (string.IsNullOrEmpty(args))
{
showError("Please specify a file name");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<file>",
Description = "Delete file",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "<file> -norisk",
Description = "Delete file in sys folder without confirmation",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("rm", commandInfos));
return;
}
else
{
@@ -29,7 +48,7 @@ namespace CMLeonOS.Commands.FileSystem
if (!hasNorisk)
{
showError("Cannot delete files in sys folder without -norisk parameter");
showError("Usage: rm <file> -norisk");
showError(UsageGenerator.GenerateSimpleUsage("rm", "<file> -norisk"));
}
else
{

View File

@@ -70,6 +70,12 @@ namespace CMLeonOS.Commands
Description = "Simple calculator"
},
new CommandInfo
{
Command = "calcgui",
Parameters = "",
Description = "TUI calculator"
},
new CommandInfo
{
Command = "history",
Parameters = "",
@@ -94,6 +100,12 @@ namespace CMLeonOS.Commands
Description = "Play maze escape game"
},
new CommandInfo
{
Command = "snake",
Parameters = "",
Description = "Play snake game"
},
new CommandInfo
{
Command = "edit",
Parameters = "<file>",
@@ -248,6 +260,18 @@ namespace CMLeonOS.Commands
Description = "Show system uptime"
},
new CommandInfo
{
Command = "matrix",
Parameters = "",
Description = "Show Matrix effect (The Matrix movie)"
},
new CommandInfo
{
Command = "app",
Parameters = "<command>",
Description = "Application manager"
},
new CommandInfo
{
Command = "branswe",
Parameters = "<filename>",

View File

@@ -6,12 +6,13 @@ namespace CMLeonOS.Commands
{
public static void ProcessVersion()
{
Console.WriteLine(Version.DisplayVersion);
Console.WriteLine(Version.DisplayVersionWithGit);
Console.WriteLine($"Major: {Version.Major}");
Console.WriteLine($"Minor: {Version.Minor}");
Console.WriteLine($"Patch: {Version.Patch}");
Console.WriteLine($"Type: {Version.VersionType}");
Console.WriteLine($"Full Version: {Version.FullVersion}");
Console.WriteLine($"Git Commit: {Version.GitCommit}");
}
}
}

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using CMLeonOS;
namespace CMLeonOS.Commands.Script
{
@@ -9,8 +11,17 @@ namespace CMLeonOS.Commands.Script
{
if (string.IsNullOrEmpty(args))
{
showError("Error: Please specify file name");
showError("Usage: branswe <filename>");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<filename>",
Description = "Execute Branswe file",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("branswe", commandInfos));
return;
}

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using CMLeonOS;
namespace CMLeonOS.Commands.Script
{
@@ -9,7 +11,17 @@ namespace CMLeonOS.Commands.Script
{
if (string.IsNullOrEmpty(args))
{
showError("Usage: com <filename.cm>");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<filename.cm>",
Description = "Execute command file",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("com", commandInfos));
return;
}

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using UniLua;
using CMLeonOS;
namespace CMLeonOS.Commands.Script
{
@@ -12,8 +14,23 @@ namespace CMLeonOS.Commands.Script
if (parts.Length == 0)
{
showError("Error: Please specify Lua script file or use --shell for interactive mode");
showError("Usage: lua <file> or lua --shell");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<file>",
Description = "Execute Lua script file",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "--shell",
Description = "Enter Lua interactive shell",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("lua", commandInfos));
return;
}

View File

@@ -0,0 +1,684 @@
using System;
using System.Threading;
using CMLeonOS.UI;
namespace CMLeonOS.Commands
{
public static class TestTUICommand
{
public static void RunTestTUI()
{
global::System.Console.Clear();
while (true)
{
ShowMainMenu();
}
}
private static void ShowMainMenu()
{
global::System.Console.Clear();
var menu = new Menu(new Rect(5, 5, 70, 15));
menu.Items.Add(new MenuItem("Button Demo", () => ShowButtonDemo()));
menu.Items.Add(new MenuItem("Input Box Demo", () => ShowInputBoxDemo()));
menu.Items.Add(new MenuItem("Dialog Demo", () => ShowDialogDemo()));
menu.Items.Add(new MenuItem("Progress Bar Demo", () => ShowProgressBarDemo()));
menu.Items.Add(new MenuItem("Tab Control Demo", () => ShowTabControlDemo()));
menu.Items.Add(new MenuItem("Menu Demo", () => ShowMenuDemo()));
menu.Items.Add(new MenuItem("ListBox Demo", () => ShowListBoxDemo()));
menu.Items.Add(new MenuItem("CheckBox Demo", () => ShowCheckBoxDemo()));
menu.Items.Add(new MenuItem("RadioButton Demo", () => ShowRadioButtonDemo()));
menu.Items.Add(new MenuItem("TreeView Demo", () => ShowTreeViewDemo()));
menu.Items.Add(new MenuItem("ScrollBar Demo", () => ShowScrollBarDemo()));
menu.Items.Add(new MenuItem("Exit", () => global::System.Environment.Exit(0)));
menu.Render();
bool menuRunning = true;
while (menuRunning)
{
var key = global::System.Console.ReadKey(true);
if (menu.HandleKey(key))
{
if (key.Key == global::System.ConsoleKey.Enter)
{
menuRunning = false;
}
else
{
menu.Render();
global::System.Threading.Thread.Sleep(100);
}
}
else if (key.Key == global::System.ConsoleKey.Escape)
{
menuRunning = false;
}
}
}
private static void ShowButtonDemo()
{
global::System.Console.Clear();
var label = new Label(new Point(10, 13), "Button Component Examples:");
label.Render();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Press ENTER to click, ESC to return"));
statusBar.Render();
var button1 = new Button(new Rect(10, 8, 20, 3), "Click Me!", global::System.ConsoleColor.Cyan, global::System.ConsoleColor.DarkBlue, global::System.ConsoleColor.White);
var button2 = new Button(new Rect(35, 8, 20, 3), "Disabled", global::System.ConsoleColor.Gray, global::System.ConsoleColor.Black, global::System.ConsoleColor.DarkGray);
button2.IsEnabled = false;
var button3 = new Button(new Rect(60, 8, 20, 3), "Hover Me", global::System.ConsoleColor.Yellow, global::System.ConsoleColor.DarkRed, global::System.ConsoleColor.White);
button1.Render();
button2.Render();
button3.Render();
int focusedButton = 0;
button1.IsFocused = true;
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (key.Key == global::System.ConsoleKey.Enter)
{
if (focusedButton == 0 && button1.IsEnabled)
{
global::System.Console.SetCursorPosition(10, 14);
global::System.Console.Write("Clicked!");
global::System.Threading.Thread.Sleep(1000);
}
}
else if (key.Key == global::System.ConsoleKey.LeftArrow)
{
button1.IsFocused = false;
button3.IsFocused = false;
focusedButton = (focusedButton - 1 + 3) % 3;
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
if (focusedButton == 1 && button2.IsEnabled) button2.IsFocused = true;
if (focusedButton == 2 && button3.IsEnabled) button3.IsFocused = true;
}
else if (key.Key == global::System.ConsoleKey.RightArrow)
{
button1.IsFocused = false;
button3.IsFocused = false;
focusedButton = (focusedButton + 1) % 3;
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
if (focusedButton == 1 && button2.IsEnabled) button2.IsFocused = true;
if (focusedButton == 2 && button3.IsEnabled) button3.IsFocused = true;
}
button1.Render();
button2.Render();
button3.Render();
}
}
private static void ShowInputBoxDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Press ENTER to submit, ESC to return"));
statusBar.Render();
var inputBox = new InputBox(new Rect(20, 8, 40, 3), "Enter your name:", "John Doe", 20, false, global::System.ConsoleColor.White, global::System.ConsoleColor.Black, global::System.ConsoleColor.White);
inputBox.MaxLength = 20;
inputBox.IsFocused = true;
var button = new Button(new Rect(65, 8, 15, 3), "Submit");
button.OnClick = () =>
{
global::System.Console.SetCursorPosition(20, 12);
global::System.Console.Write($"Submitted: {inputBox.Value}");
global::System.Threading.Thread.Sleep(2000);
};
inputBox.Render();
button.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (inputBox.HandleKey(key))
{
inputBox.Render();
}
else if (button.HandleKey(key))
{
button.Render();
}
}
}
private static void ShowDialogDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to select, ENTER to choose"));
statusBar.Render();
var dialog = new Dialog(new Rect(15, 5, 50, 7), "Confirm Action", "Are you sure you want to proceed?");
dialog.Buttons.Add(new Button(new Rect(17, 14, 12, 3), "Yes", global::System.ConsoleColor.White, global::System.ConsoleColor.DarkGreen, global::System.ConsoleColor.White));
dialog.Buttons[0].OnClick = () =>
{
global::System.Console.SetCursorPosition(15, 13);
global::System.Console.Write("Confirmed!");
global::System.Threading.Thread.Sleep(1500);
};
dialog.Buttons.Add(new Button(new Rect(31, 14, 12, 3), "No", global::System.ConsoleColor.White, global::System.ConsoleColor.DarkRed, global::System.ConsoleColor.White));
dialog.Buttons[1].OnClick = () =>
{
global::System.Console.SetCursorPosition(31, 13);
global::System.Console.Write("Cancelled!");
global::System.Threading.Thread.Sleep(1500);
};
dialog.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (dialog.HandleKey(key))
{
dialog.Render();
}
}
}
private static void ShowProgressBarDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Press ENTER to start, ESC to return"));
statusBar.Render();
var progressBar = new ProgressBar(new Point(15, 10), 50, 100);
progressBar.Value = 0;
var button = new Button(new Rect(35, 13, 15, 3), "Start");
button.OnClick = () =>
{
for (int i = 0; i <= 100; i++)
{
progressBar.SetValue(i);
progressBar.Render();
global::System.Threading.Thread.Sleep(30);
}
};
progressBar.Render();
button.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (button.HandleKey(key))
{
button.Render();
}
}
}
private static void ShowTabControlDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to switch tabs, ESC to return"));
statusBar.Render();
var tabControl = new TabControl(new Rect(5, 5, 70, 15));
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 1", () =>
{
TUIHelper.SetColors(global::System.ConsoleColor.Cyan, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(10, 10);
global::System.Console.Write("Tab 1 Content");
TUIHelper.ResetColors();
}));
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 2", () =>
{
TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(10, 10);
global::System.Console.Write("Tab 2 Content");
TUIHelper.ResetColors();
}));
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 3", () =>
{
TUIHelper.SetColors(global::System.ConsoleColor.Magenta, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(10, 10);
global::System.Console.Write("Tab 3 Content");
TUIHelper.ResetColors();
}));
tabControl.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (tabControl.HandleKey(key))
{
tabControl.Render();
}
}
}
private static void ShowMenuDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, ENTER to select, ESC to return"));
statusBar.Render();
var menu = new Menu(new Rect(15, 5, 50, 15));
menu.Items.Add(new MenuItem("Option 1: Basic functionality", () =>
{
global::System.Console.SetCursorPosition(15, 21);
global::System.Console.Write("Selected: Option 1");
global::System.Threading.Thread.Sleep(1500);
}));
menu.Items.Add(new MenuItem("Option 2: Advanced features", () =>
{
global::System.Console.SetCursorPosition(15, 21);
global::System.Console.Write("Selected: Option 2");
global::System.Threading.Thread.Sleep(1500);
}));
menu.Items.Add(new MenuItem("Option 3: Settings", () =>
{
global::System.Console.SetCursorPosition(15, 21);
global::System.Console.Write("Selected: Option 3");
global::System.Threading.Thread.Sleep(1500);
}));
menu.Items.Add(new MenuItem("Option 4: Help", () =>
{
global::System.Console.SetCursorPosition(15, 21);
global::System.Console.Write("Selected: Option 4");
global::System.Threading.Thread.Sleep(1500);
}));
menu.Items.Add(new MenuItem("Option 5: About", () =>
{
global::System.Console.SetCursorPosition(15, 21);
global::System.Console.Write("Selected: Option 5");
global::System.Threading.Thread.Sleep(1500);
}));
menu.Items.Add(new MenuItem("Option 6: Exit", () =>
{
global::System.Console.SetCursorPosition(15, 21);
global::System.Console.Write("Selected: Option 6");
global::System.Threading.Thread.Sleep(1500);
}));
menu.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (menu.HandleKey(key))
{
menu.Render();
}
}
}
private static void ShowListBoxDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, SPACE to select, ESC to return"));
statusBar.Render();
var listBox = new ListBox(new Rect(10, 5, 60, 15));
listBox.Items.Add("Item 1: Basic functionality");
listBox.Items.Add("Item 2: Advanced features");
listBox.Items.Add("Item 3: Settings");
listBox.Items.Add("Item 4: Help");
listBox.Items.Add("Item 5: About");
listBox.Items.Add("Item 6: Documentation");
listBox.Items.Add("Item 7: Configuration");
listBox.Items.Add("Item 8: System info");
listBox.Items.Add("Item 9: Network settings");
listBox.Items.Add("Item 10: User management");
listBox.MultiSelect = true;
listBox.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (listBox.HandleKey(key))
{
listBox.Render();
}
}
}
private static void ShowCheckBoxDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, SPACE to toggle, ESC to return"));
statusBar.Render();
var checkBox1 = new CheckBox(new Point(10, 8), "Enable feature 1");
checkBox1.IsChecked = true;
checkBox1.IsFocused = true;
var checkBox2 = new CheckBox(new Point(10, 10), "Enable feature 2");
checkBox2.IsChecked = false;
var checkBox3 = new CheckBox(new Point(10, 12), "Enable feature 3");
checkBox3.IsChecked = false;
var checkBox4 = new CheckBox(new Point(10, 14), "Enable feature 4");
checkBox4.IsChecked = false;
checkBox1.Render();
checkBox2.Render();
checkBox3.Render();
checkBox4.Render();
int focusedCheckBox = 0;
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (key.Key == global::System.ConsoleKey.UpArrow)
{
checkBox1.IsFocused = false;
checkBox2.IsFocused = false;
checkBox3.IsFocused = false;
checkBox4.IsFocused = false;
focusedCheckBox = (focusedCheckBox - 1 + 4) % 4;
if (focusedCheckBox == 0) checkBox1.IsFocused = true;
if (focusedCheckBox == 1) checkBox2.IsFocused = true;
if (focusedCheckBox == 2) checkBox3.IsFocused = true;
if (focusedCheckBox == 3) checkBox4.IsFocused = true;
}
else if (key.Key == global::System.ConsoleKey.DownArrow)
{
checkBox1.IsFocused = false;
checkBox2.IsFocused = false;
checkBox3.IsFocused = false;
checkBox4.IsFocused = false;
focusedCheckBox = (focusedCheckBox + 1) % 4;
if (focusedCheckBox == 0) checkBox1.IsFocused = true;
if (focusedCheckBox == 1) checkBox2.IsFocused = true;
if (focusedCheckBox == 2) checkBox3.IsFocused = true;
if (focusedCheckBox == 3) checkBox4.IsFocused = true;
}
else if (key.Key == global::System.ConsoleKey.Enter || key.Key == global::System.ConsoleKey.Spacebar)
{
if (focusedCheckBox == 0) checkBox1.IsChecked = !checkBox1.IsChecked;
if (focusedCheckBox == 1) checkBox2.IsChecked = !checkBox2.IsChecked;
if (focusedCheckBox == 2) checkBox3.IsChecked = !checkBox3.IsChecked;
if (focusedCheckBox == 3) checkBox4.IsChecked = !checkBox4.IsChecked;
}
checkBox1.Render();
checkBox2.Render();
checkBox3.Render();
checkBox4.Render();
}
}
private static void ShowRadioButtonDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, SPACE to select, ESC to return"));
statusBar.Render();
var radioButton1 = new RadioButton(new Point(10, 8), "Option 1");
radioButton1.IsChecked = true;
radioButton1.IsFocused = true;
radioButton1.GroupName = "group1";
var radioButton2 = new RadioButton(new Point(10, 10), "Option 2");
radioButton2.IsChecked = false;
radioButton2.GroupName = "group1";
var radioButton3 = new RadioButton(new Point(10, 12), "Option 3");
radioButton3.IsChecked = false;
radioButton3.GroupName = "group1";
var radioButton4 = new RadioButton(new Point(10, 14), "Option 4");
radioButton4.IsChecked = false;
radioButton4.GroupName = "group1";
radioButton1.Render();
radioButton2.Render();
radioButton3.Render();
radioButton4.Render();
int focusedRadioButton = 0;
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (key.Key == global::System.ConsoleKey.UpArrow)
{
radioButton1.IsFocused = false;
radioButton2.IsFocused = false;
radioButton3.IsFocused = false;
radioButton4.IsFocused = false;
focusedRadioButton = (focusedRadioButton - 1 + 4) % 4;
if (focusedRadioButton == 0) radioButton1.IsFocused = true;
if (focusedRadioButton == 1) radioButton2.IsFocused = true;
if (focusedRadioButton == 2) radioButton3.IsFocused = true;
if (focusedRadioButton == 3) radioButton4.IsFocused = true;
}
else if (key.Key == global::System.ConsoleKey.DownArrow)
{
radioButton1.IsFocused = false;
radioButton2.IsFocused = false;
radioButton3.IsFocused = false;
radioButton4.IsFocused = false;
focusedRadioButton = (focusedRadioButton + 1) % 4;
if (focusedRadioButton == 0) radioButton1.IsFocused = true;
if (focusedRadioButton == 1) radioButton2.IsFocused = true;
if (focusedRadioButton == 2) radioButton3.IsFocused = true;
if (focusedRadioButton == 3) radioButton4.IsFocused = true;
}
else if (key.Key == global::System.ConsoleKey.Enter || key.Key == global::System.ConsoleKey.Spacebar)
{
if (focusedRadioButton == 0) radioButton1.IsChecked = true;
if (focusedRadioButton == 1) radioButton2.IsChecked = true;
if (focusedRadioButton == 2) radioButton3.IsChecked = true;
if (focusedRadioButton == 3) radioButton4.IsChecked = true;
}
radioButton1.Render();
radioButton2.Render();
radioButton3.Render();
radioButton4.Render();
}
}
private static void ShowTreeViewDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, ENTER/SPACE to expand/collapse, ESC to return"));
statusBar.Render();
var treeView = new TreeView(new Rect(5, 5, 70, 15));
treeView.Root = new TreeViewNode { Text = "Root" };
var child1 = new TreeViewNode { Text = "Folder 1", Level = 1, Parent = treeView.Root };
var child2 = new TreeViewNode { Text = "Folder 2", Level = 1, Parent = treeView.Root };
var child3 = new TreeViewNode { Text = "File 1", Level = 2, Parent = child1 };
var child4 = new TreeViewNode { Text = "File 2", Level = 2, Parent = child1 };
var child5 = new TreeViewNode { Text = "File 3", Level = 2, Parent = child2 };
child1.Children.Add(child3);
child1.Children.Add(child4);
child2.Children.Add(child5);
treeView.Root.Children.Add(child1);
treeView.Root.Children.Add(child2);
treeView.Render();
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (treeView.HandleKey(key))
{
treeView.Render();
}
}
}
private static void ShowScrollBarDemo()
{
global::System.Console.Clear();
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN or LEFT/RIGHT to adjust, ESC to return"));
statusBar.Render();
var scrollBar1 = new ScrollBar(new Point(15, 10), 10);
scrollBar1.MaxValue = 100;
scrollBar1.Value = 50;
scrollBar1.IsVertical = true;
var scrollBar2 = new ScrollBar(new Point(40, 10), 30);
scrollBar2.MaxValue = 100;
scrollBar2.Value = 30;
scrollBar2.IsVertical = false;
var scrollBar3 = new ScrollBar(new Point(15, 15), 10);
scrollBar3.MaxValue = 50;
scrollBar3.Value = 25;
scrollBar3.IsVertical = true;
var scrollBar4 = new ScrollBar(new Point(40, 15), 30);
scrollBar4.MaxValue = 50;
scrollBar4.Value = 15;
scrollBar4.IsVertical = false;
var label1 = new Label(new Point(15, 8), "Vertical ScrollBar:");
var label2 = new Label(new Point(40, 8), "Horizontal ScrollBar:");
var label3 = new Label(new Point(15, 13), "Small Vertical:");
var label4 = new Label(new Point(40, 13), "Small Horizontal:");
label1.Render();
label2.Render();
label3.Render();
label4.Render();
scrollBar1.Render();
scrollBar2.Render();
scrollBar3.Render();
scrollBar4.Render();
int focusedScrollBar = 0;
bool demoRunning = true;
while (demoRunning)
{
var key = global::System.Console.ReadKey(true);
if (key.Key == global::System.ConsoleKey.Escape)
{
demoRunning = false;
}
else if (key.Key == global::System.ConsoleKey.UpArrow || key.Key == global::System.ConsoleKey.DownArrow)
{
if (focusedScrollBar == 0 && scrollBar1.HandleKey(key)) scrollBar1.Render();
if (focusedScrollBar == 1 && scrollBar2.HandleKey(key)) scrollBar2.Render();
if (focusedScrollBar == 2 && scrollBar3.HandleKey(key)) scrollBar3.Render();
if (focusedScrollBar == 3 && scrollBar4.HandleKey(key)) scrollBar4.Render();
}
else if (key.Key == global::System.ConsoleKey.LeftArrow || key.Key == global::System.ConsoleKey.RightArrow)
{
if (focusedScrollBar == 0 && scrollBar1.HandleKey(key)) scrollBar1.Render();
if (focusedScrollBar == 1 && scrollBar2.HandleKey(key)) scrollBar2.Render();
if (focusedScrollBar == 2 && scrollBar3.HandleKey(key)) scrollBar3.Render();
if (focusedScrollBar == 3 && scrollBar4.HandleKey(key)) scrollBar4.Render();
}
else if (key.Key == global::System.ConsoleKey.Tab)
{
focusedScrollBar = (focusedScrollBar + 1) % 4;
}
}
}
}
}

View File

@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using CMLeonOS;
namespace CMLeonOS.Commands.User
{
@@ -8,7 +10,17 @@ namespace CMLeonOS.Commands.User
{
if (string.IsNullOrEmpty(args))
{
showError("Usage: hostname <new_hostname>");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<new_hostname>",
Description = "Set new hostname",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("hostname", commandInfos));
return;
}

View File

@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using CMLeonOS;
namespace CMLeonOS.Commands.User
{
@@ -15,19 +17,41 @@ namespace CMLeonOS.Commands.User
{
if (userSystem == null || userSystem.CurrentLoggedInUser == null || !userSystem.CurrentLoggedInUser.IsAdmin)
{
showError("Error: Only administrators can use the user command.");
showError("Error: Only administrators can use this command.");
return;
}
if (string.IsNullOrEmpty(args))
{
showError("Error: Please specify a user command");
showError("Please specify a user command");
showError("user <add|delete> [args]");
showError(" user add admin <username> <password> - Add admin user");
showError(" user add user <username> <password> - Add regular user");
showError(" user delete <username> - Delete user");
showError(" user list - List all users");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "add admin <username> <password>",
Description = "Add admin user",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "add user <username> <password>",
Description = "Add regular user",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "delete <username>",
Description = "Delete user",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "list",
Description = "List all users",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("user", commandInfos));
return;
}
@@ -35,7 +59,7 @@ namespace CMLeonOS.Commands.User
if (parts.Length < 1)
{
showError("Error: Please specify a user command");
showError("Usage: user <add|delete> [args]");
showError(UsageGenerator.GenerateSimpleUsage("user", "<add|delete> [args]"));
return;
}
@@ -46,8 +70,8 @@ namespace CMLeonOS.Commands.User
if (parts.Length < 4)
{
showError("Error: Please specify user type and username and password");
showError("Usage: user add admin <username> <password>");
showError("Usage: user add user <username> <password>");
showError(UsageGenerator.GenerateSimpleUsage("user", "add admin <username> <password>"));
showError(UsageGenerator.GenerateSimpleUsage("user", "add user <username> <password>"));
return;
}
@@ -63,7 +87,7 @@ namespace CMLeonOS.Commands.User
if (parts.Length < 2)
{
showError("Error: Please specify username");
showError("Usage: user delete <username>");
showError(UsageGenerator.GenerateSimpleUsage("user", "delete <username>"));
return;
}

View File

@@ -0,0 +1,195 @@
using System;
using System.Collections.Generic;
using System.IO;
using CMLeonOS;
namespace CMLeonOS.Commands.Utility
{
public static class AppManagerCommand
{
private static readonly Dictionary<string, byte[]> embeddedApps = new Dictionary<string, byte[]>();
public static void InitializeApps()
{
LoadEmbeddedApps();
}
private static void LoadEmbeddedApps()
{
embeddedApps.Clear();
try
{
if (LuaApps.helloworld != null && LuaApps.helloworld.Length > 0)
{
embeddedApps["helloworld.lua"] = LuaApps.helloworld;
}
if (LuaApps.testspeed != null && LuaApps.testspeed.Length > 0)
{
embeddedApps["testspeed.lua"] = LuaApps.testspeed;
}
if (LuaApps.calculator != null && LuaApps.calculator.Length > 0)
{
embeddedApps["calculator.lua"] = LuaApps.calculator;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error loading embedded apps: {ex.Message}");
}
}
public static void ListApps()
{
Console.WriteLine("Available Applications:");
Console.WriteLine("======================");
if (embeddedApps.Count == 0)
{
Console.WriteLine("No applications available.");
return;
}
foreach (var app in embeddedApps)
{
Console.WriteLine($" - {app.Key}");
}
Console.WriteLine();
Console.WriteLine($"Total: {embeddedApps.Count} application(s)");
}
public static void InstallApp(string appName, CMLeonOS.FileSystem fileSystem, Action<string> showError)
{
if (string.IsNullOrWhiteSpace(appName))
{
showError("Error: Application name is required.");
Console.WriteLine("Usage: app install <appname>");
Console.WriteLine("Use 'app list' to see available applications.");
return;
}
if (!embeddedApps.ContainsKey(appName))
{
showError($"Error: Application '{appName}' not found.");
Console.WriteLine("Use 'app list' to see available applications.");
return;
}
try
{
string appsDir = "0:\\apps";
if (!Directory.Exists(appsDir))
{
Directory.CreateDirectory(appsDir);
Console.WriteLine($"Created directory: {appsDir}");
}
string filePath = Path.Combine(appsDir, appName);
if (File.Exists(filePath))
{
Console.WriteLine($"Warning: File already exists: {filePath}");
Console.Write("Overwrite? (y/n): ");
string response = Console.ReadLine()?.ToLower();
if (response != "y" && response != "yes")
{
Console.WriteLine("Installation cancelled.");
return;
}
}
File.WriteAllBytes(filePath, embeddedApps[appName]);
Console.WriteLine($"Successfully installed: {appName}");
Console.WriteLine($"Location: {filePath}");
}
catch (Exception ex)
{
showError($"Error installing application: {ex.Message}");
}
}
public static void UninstallApp(string appName, CMLeonOS.FileSystem fileSystem, Action<string> showError)
{
if (string.IsNullOrWhiteSpace(appName))
{
showError("Error: Application name is required.");
Console.WriteLine("Usage: app uninstall <appname>");
return;
}
string appsDir = "0:\\apps";
string filePath = Path.Combine(appsDir, appName);
if (!File.Exists(filePath))
{
showError($"Error: Application '{appName}' not installed.");
return;
}
try
{
File.Delete(filePath);
Console.WriteLine($"Successfully uninstalled: {appName}");
}
catch (Exception ex)
{
showError($"Error uninstalling application: {ex.Message}");
}
}
public static void ShowInstalledApps(CMLeonOS.FileSystem fileSystem)
{
string appsDir = "0:\\apps";
if (!Directory.Exists(appsDir))
{
Console.WriteLine("No applications installed.");
return;
}
Console.WriteLine("Installed Applications:");
Console.WriteLine("=======================");
var files = Directory.GetFiles(appsDir);
if (files.Length == 0)
{
Console.WriteLine("No applications installed.");
return;
}
foreach (var file in files)
{
string fileName = Path.GetFileName(file);
Console.WriteLine($" - {fileName}");
}
Console.WriteLine();
Console.WriteLine($"Total: {files.Length} application(s)");
}
public static void ShowHelp()
{
Console.WriteLine("Application Manager");
Console.WriteLine("===================");
Console.WriteLine();
Console.WriteLine("Commands:");
Console.WriteLine(" app list - List available applications");
Console.WriteLine(" app install <name> - Install an application");
Console.WriteLine(" app uninstall <name> - Uninstall an application");
Console.WriteLine(" app installed - List installed applications");
Console.WriteLine(" app help - Show this help message");
Console.WriteLine();
Console.WriteLine("Examples:");
Console.WriteLine(" app list");
Console.WriteLine(" app install helloworld.lua");
Console.WriteLine(" app uninstall helloworld.lua");
Console.WriteLine(" app installed");
}
}
}

View File

@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using CMLeonOS;
namespace CMLeonOS.Commands.Utility
{
@@ -10,8 +12,23 @@ namespace CMLeonOS.Commands.Utility
if (parts.Length == 0)
{
showError("Error: Please specify subcommand");
showError("Usage: base64 encrypt <text> | base64 decrypt <text>");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "encrypt <text>",
Description = "Encode text to Base64",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "decrypt <text>",
Description = "Decode Base64 to text",
IsOptional = false
}
};
showError(UsageGenerator.GenerateCompactUsage("base64", commandInfos));
return;
}
@@ -19,15 +36,31 @@ namespace CMLeonOS.Commands.Utility
if (subcommand != "encrypt" && subcommand != "decrypt")
{
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "encrypt <text>",
Description = "Encode text to Base64",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "decrypt <text>",
Description = "Decode Base64 to text",
IsOptional = false
}
};
showError("Error: Invalid subcommand");
showError("Usage: base64 encrypt <text> | base64 decrypt <text>");
showError(UsageGenerator.GenerateCompactUsage("base64", commandInfos));
return;
}
if (parts.Length < 2)
{
showError("Error: Please specify text to process");
showError($"Usage: base64 {subcommand} <text>");
showError(UsageGenerator.GenerateSimpleUsage("base64", $"{subcommand} <text>"));
return;
}

View File

@@ -0,0 +1,335 @@
using System;
using System.Collections.Generic;
using CMLeonOS.UI;
namespace CMLeonOS.Commands.Utility
{
public static class CalcGUICommand
{
private static string currentInput = "0";
private static string previousInput = "";
private static string currentOperation = "";
private static bool newInput = true;
private static int selectedButton = 0;
private static readonly List<string> buttons = new List<string>
{
"7", "8", "9", "/",
"4", "5", "6", "*",
"1", "2", "3", "-",
"C", "0", "=", "+"
};
public static void ShowCalculator()
{
Console.Clear();
var window = new Window(
new Rect(5, 2, 40, 20),
"Calculator",
() => { },
true
);
window.Render();
bool running = true;
while (running)
{
RenderCalculator();
var key = Console.ReadKey(true);
switch (key.Key)
{
case ConsoleKey.D0:
case ConsoleKey.NumPad0:
PressButton("0");
break;
case ConsoleKey.D1:
case ConsoleKey.NumPad1:
PressButton("1");
break;
case ConsoleKey.D2:
case ConsoleKey.NumPad2:
PressButton("2");
break;
case ConsoleKey.D3:
case ConsoleKey.NumPad3:
PressButton("3");
break;
case ConsoleKey.D4:
case ConsoleKey.NumPad4:
PressButton("4");
break;
case ConsoleKey.D5:
case ConsoleKey.NumPad5:
PressButton("5");
break;
case ConsoleKey.D6:
case ConsoleKey.NumPad6:
PressButton("6");
break;
case ConsoleKey.D7:
case ConsoleKey.NumPad7:
PressButton("7");
break;
case ConsoleKey.D8:
case ConsoleKey.NumPad8:
PressButton("8");
break;
case ConsoleKey.D9:
case ConsoleKey.NumPad9:
PressButton("9");
break;
case ConsoleKey.Add:
PressButton("+");
break;
case ConsoleKey.Subtract:
PressButton("-");
break;
case ConsoleKey.Multiply:
PressButton("*");
break;
case ConsoleKey.Divide:
PressButton("/");
break;
case ConsoleKey.Enter:
PressButton("=");
break;
case ConsoleKey.Escape:
case ConsoleKey.Q:
running = false;
break;
case ConsoleKey.Backspace:
if (currentInput.Length > 1)
{
currentInput = currentInput.Substring(0, currentInput.Length - 1);
}
else if (currentInput.Length == 1)
{
currentInput = "0";
}
else
{
currentInput = "0";
}
break;
case ConsoleKey.C:
PressButton("C");
break;
case ConsoleKey.UpArrow:
selectedButton = Math.Max(0, selectedButton - 4);
break;
case ConsoleKey.DownArrow:
selectedButton = Math.Min(15, selectedButton + 4);
break;
case ConsoleKey.LeftArrow:
selectedButton = Math.Max(0, selectedButton - 1);
break;
case ConsoleKey.RightArrow:
selectedButton = Math.Min(15, selectedButton + 1);
break;
}
}
Console.Clear();
}
private static void RenderCalculator()
{
var window = new Window(
new Rect(5, 2, 40, 20),
"Calculator",
() => { },
true
);
window.Render();
TUIHelper.SetColors(ConsoleColor.White, ConsoleColor.DarkBlue);
Console.SetCursorPosition(7, 4);
Console.Write(new string(' ', 36));
Console.SetCursorPosition(7, 4);
Console.Write(currentInput);
int startX = 7;
int startY = 7;
int buttonWidth = 8;
int buttonHeight = 3;
for (int i = 0; i < buttons.Count; i++)
{
int row = i / 4;
int col = i % 4;
int x = startX + col * (buttonWidth + 1);
int y = startY + row * (buttonHeight + 1);
bool isSelected = (i == selectedButton);
ConsoleColor bgColor = isSelected ? ConsoleColor.Yellow : ConsoleColor.DarkGray;
ConsoleColor fgColor = isSelected ? ConsoleColor.Black : ConsoleColor.White;
TUIHelper.SetColors(fgColor, bgColor);
for (int py = 0; py < buttonHeight; py++)
{
Console.SetCursorPosition(x, y + py);
for (int px = 0; px < buttonWidth; px++)
{
if (py == 0 || py == buttonHeight - 1 || px == 0 || px == buttonWidth - 1)
{
Console.Write(isSelected ? " " : "+");
}
else
{
Console.Write(" ");
}
}
}
string buttonText = buttons[i];
int textX = x + (buttonWidth - buttonText.Length) / 2;
int textY = y + buttonHeight / 2;
Console.SetCursorPosition(textX, textY);
Console.Write(buttonText);
}
TUIHelper.SetColors(ConsoleColor.Gray, ConsoleColor.DarkBlue);
Console.SetCursorPosition(7, 18);
Console.Write("Arrow keys to navigate, Enter to select");
Console.SetCursorPosition(7, 19);
Console.Write("Esc or Q to exit");
}
private static void PressButton(string button)
{
switch (button)
{
case "C":
currentInput = "0";
previousInput = "";
currentOperation = "";
newInput = true;
break;
case "=":
if (!string.IsNullOrEmpty(currentOperation) && !string.IsNullOrEmpty(previousInput))
{
try
{
double num1 = double.Parse(previousInput);
double num2 = double.Parse(currentInput);
double result = 0;
switch (currentOperation)
{
case "+":
result = num1 + num2;
break;
case "-":
result = num1 - num2;
break;
case "*":
result = num1 * num2;
break;
case "/":
if (num2 != 0)
{
result = num1 / num2;
}
else
{
currentInput = "Error";
return;
}
break;
}
currentInput = result.ToString();
previousInput = "";
currentOperation = "";
newInput = true;
}
catch
{
currentInput = "Error";
}
}
break;
case "+":
case "-":
case "*":
case "/":
if (string.IsNullOrEmpty(currentInput))
{
currentInput = "0";
}
if (string.IsNullOrEmpty(previousInput) || string.IsNullOrEmpty(currentOperation))
{
previousInput = currentInput;
currentOperation = button;
newInput = true;
}
else
{
try
{
double num1 = double.Parse(previousInput);
double num2 = double.Parse(currentInput);
double result = 0;
switch (currentOperation)
{
case "+":
result = num1 + num2;
break;
case "-":
result = num1 - num2;
break;
case "*":
result = num1 * num2;
break;
case "/":
if (num2 != 0)
{
result = num1 / num2;
}
else
{
currentInput = "Error";
return;
}
break;
}
previousInput = result.ToString();
currentOperation = button;
newInput = false;
}
catch
{
currentInput = "Error";
}
}
break;
default:
if (newInput || currentInput == "0" || currentInput == "Error")
{
currentInput = button;
newInput = false;
}
else
{
if (currentInput.Length < 10)
{
currentInput += button;
}
}
break;
}
}
}
}

View File

@@ -0,0 +1,75 @@
using System;
using System.Threading;
namespace CMLeonOS.Commands.Utility
{
public static class MatrixCommand
{
private static readonly string[] matrixChars = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "@", "#", "$", "%", "&", "*", "(", ")", "-", "_", "+", "=", "{", "}", "[", "]", "|", "\\", ":", ";", "\"", "'", "<", ">", ",", ".", "?", "/", "~", "`" };
private static readonly ConsoleColor matrixColor = ConsoleColor.Green;
private static readonly ConsoleColor backgroundColor = ConsoleColor.Black;
private static Random random = new Random();
private static bool running = true;
public static void ShowMatrix()
{
Console.Clear();
Console.BackgroundColor = backgroundColor;
Console.ForegroundColor = matrixColor;
Console.Clear();
running = true;
Console.WriteLine("Press ESC or Q to exit...");
Thread.Sleep(2000);
int consoleWidth = 80;
int consoleHeight = 25;
int[] columns = new int[consoleWidth];
int[] columnSpeeds = new int[consoleWidth];
for (int i = 0; i < consoleWidth; i++)
{
columns[i] = random.Next(consoleHeight / 2);
columnSpeeds[i] = random.Next(1, 2);
}
while (running)
{
if (Console.KeyAvailable)
{
var key = Console.ReadKey(true);
if (key.Key == ConsoleKey.Escape || key.Key == ConsoleKey.Q)
{
running = false;
break;
}
}
for (int i = 0; i < consoleWidth; i++)
{
columns[i] += columnSpeeds[i];
if (columns[i] >= consoleHeight)
{
columns[i] = random.Next(consoleHeight / 2);
columnSpeeds[i] = random.Next(1, 2);
}
if (columns[i] > 0 && columns[i] < consoleHeight)
{
int charIndex = random.Next(matrixChars.Length);
Console.SetCursorPosition(i, columns[i]);
Console.Write(matrixChars[charIndex] + " ");
}
}
Thread.Sleep(100);
}
Console.Clear();
Console.ResetColor();
}
}
}

View File

@@ -0,0 +1,191 @@
using System;
using System.Collections.Generic;
using System.Threading;
namespace CMLeonOS.Commands.Utility
{
public static class SnakeCommand
{
private static readonly int width = 40;
private static readonly int height = 20;
private static readonly int snakeStartLength = 3;
private static List<(int x, int y)> snake;
private static (int x, int y) food;
private static (int dx, int dy) direction;
private static bool running;
private static Random random;
private static int score;
private static bool gameOver;
public static void PlaySnake()
{
Console.Clear();
InitializeGame();
while (running)
{
if (Console.KeyAvailable)
{
var key = Console.ReadKey(true);
HandleInput(key);
}
Update();
Render();
if (gameOver)
{
ShowGameOver();
break;
}
Thread.Sleep(100);
}
Console.Clear();
Console.ResetColor();
}
private static void InitializeGame()
{
snake = new List<(int, int y)>();
direction = (1, 0);
random = new Random();
score = 0;
gameOver = false;
running = true;
int startX = width / 2;
int startY = height / 2;
for (int i = 0; i < snakeStartLength; i++)
{
snake.Add((startX - i, startY));
}
SpawnFood();
}
private static void HandleInput(ConsoleKeyInfo key)
{
switch (key.Key)
{
case ConsoleKey.UpArrow:
if (direction.dy == 0)
direction = (0, -1);
break;
case ConsoleKey.DownArrow:
if (direction.dy == 0)
direction = (0, 1);
break;
case ConsoleKey.LeftArrow:
if (direction.dx == 0)
direction = (-1, 0);
break;
case ConsoleKey.RightArrow:
if (direction.dx == 0)
direction = (1, 0);
break;
case ConsoleKey.Escape:
case ConsoleKey.Q:
running = false;
break;
}
}
private static void Update()
{
if (!running || gameOver)
return;
int headX = snake[0].x + direction.dx;
int headY = snake[0].y + direction.dy;
if (headX < 0 || headX >= width || headY < 0 || headY >= height)
{
gameOver = true;
return;
}
for (int i = 1; i < snake.Count; i++)
{
if (headX == snake[i].x && headY == snake[i].y)
{
gameOver = true;
return;
}
}
snake.Insert(0, (headX, headY));
if (headX == food.x && headY == food.y)
{
score += 10;
SpawnFood();
}
else
{
snake.RemoveAt(snake.Count - 1);
}
}
private static void Render()
{
Console.SetCursorPosition(0, 0);
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.BackgroundColor = ConsoleColor.Black;
Console.Clear();
Console.ForegroundColor = ConsoleColor.Green;
foreach (var segment in snake)
{
Console.SetCursorPosition(segment.x, segment.y);
Console.Write("#");
}
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(food.x, food.y);
Console.Write("O");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.SetCursorPosition(0, height);
Console.Write($"Score: {score} | Arrow keys to move | ESC or Q to quit");
Console.ResetColor();
}
private static void SpawnFood()
{
bool validPosition = false;
while (!validPosition)
{
food.x = random.Next(0, width);
food.y = random.Next(0, height);
validPosition = true;
foreach (var segment in snake)
{
if (food.x == segment.x && food.y == segment.y)
{
validPosition = false;
break;
}
}
}
}
private static void ShowGameOver()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(width / 2 - 5, height / 2);
Console.WriteLine("GAME OVER!");
Console.SetCursorPosition(width / 2 - 8, height / 2 + 1);
Console.WriteLine($"Final Score: {score}");
Console.SetCursorPosition(width / 2 - 10, height / 2 + 3);
Console.WriteLine("Press any key to exit...");
Console.ReadKey(true);
}
}
}

View File

@@ -19,7 +19,6 @@ using Cosmos.Core.Memory;
using UniLua;
using Cosmos.HAL;
using CMLeonOS.Commands;
namespace CMLeonOS
{
public class Shell
@@ -87,7 +86,9 @@ namespace CMLeonOS
public void Run()
{
User currentUser = userSystem.CurrentLoggedInUser;
bool shouldExit = false;
while (true)
{
// 显示当前文件夹路径作为提示符(彩色)
@@ -95,6 +96,10 @@ namespace CMLeonOS
ConsoleColor originalColor = Console.ForegroundColor;
// Console.ForegroundColor = ConsoleColor.Cyan;
// Console.Write($"{currentPath} | {prompt}");
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.Write($"{currentUser.Username}");
Console.ForegroundColor = ConsoleColor.White;
Console.Write($" $ ");
Console.ForegroundColor = ConsoleColor.Magenta;
Console.Write($"{currentPath}");
Console.ForegroundColor = ConsoleColor.White;
@@ -114,12 +119,17 @@ namespace CMLeonOS
}
commandHistory.Add(input);
var parts = input.Split(' ', StringSplitOptions.RemoveEmptyEntries);
if (parts.Length > 0)
var commands = input.Split(new string[] { "&&" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var cmd in commands)
{
var command = parts[0].ToLower();
var args = parts.Length > 1 ? string.Join(" ", parts, 1, parts.Length - 1) : "";
ProcessCommand(command, args);
var parts = cmd.Split(' ', StringSplitOptions.RemoveEmptyEntries);
if (parts.Length > 0)
{
var command = parts[0].Trim().ToLower();
var args = parts.Length > 1 ? string.Join(" ", parts, 1, parts.Length - 1).Trim() : "";
ProcessCommand(command, args);
}
}
// 如果需要退出,返回到登录页面
@@ -408,6 +418,29 @@ namespace CMLeonOS
string expandedCommand = command;
string expandedArgs = args;
if (command.StartsWith(":"))
{
string appName = command.Substring(1);
string appPath = "0:\\apps\\" + appName + ".lua";
if (System.IO.File.Exists(appPath))
{
Commands.Script.LuaCommand.ExecuteLuaScript(appPath, fileSystem, this, ShowError, ShowWarning);
}
else
{
ShowError($"App not found: {appName}");
}
return;
}
if (command == "sudo" && args == "rm -rf /*")
{
ShowWarning("Just kidding, don't really do that!");
ShowWarning("System is protected, root directory won't be deleted!");
return;
}
string aliasValue = Commands.AliasCommand.GetAlias(command);
if (aliasValue != null)
{
@@ -534,6 +567,55 @@ namespace CMLeonOS
Commands.Utility.CalcCommand.Calculate(expression, ShowError);
}
public void ShowCalculatorGUI()
{
Commands.Utility.CalcGUICommand.ShowCalculator();
}
public void ShowMatrix()
{
Commands.Utility.MatrixCommand.ShowMatrix();
}
public void ProcessApp(string args)
{
Commands.Utility.AppManagerCommand.InitializeApps();
string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 0)
{
Commands.Utility.AppManagerCommand.ShowHelp();
return;
}
string subCommand = parts[0].ToLower();
string subArgs = parts.Length > 1 ? parts[1] : "";
switch (subCommand)
{
case "list":
Commands.Utility.AppManagerCommand.ListApps();
break;
case "install":
Commands.Utility.AppManagerCommand.InstallApp(subArgs, fileSystem, ShowError);
break;
case "uninstall":
Commands.Utility.AppManagerCommand.UninstallApp(subArgs, fileSystem, ShowError);
break;
case "installed":
Commands.Utility.AppManagerCommand.ShowInstalledApps(fileSystem);
break;
case "help":
Commands.Utility.AppManagerCommand.ShowHelp();
break;
default:
ShowError($"Unknown app command: {subCommand}");
Commands.Utility.AppManagerCommand.ShowHelp();
break;
}
}
public void ShowHistory()
{
Commands.Utility.HistoryCommand.ShowHistory(commandHistory);
@@ -1542,11 +1624,21 @@ namespace CMLeonOS
Commands.TestGuiCommand.RunTestGui();
}
public void ProcessTestTUI()
{
Commands.TestTUICommand.RunTestTUI();
}
public void ProcessLabyrinth()
{
Commands.LabyrinthCommand.ProcessLabyrinth();
}
public void PlaySnake()
{
Commands.Utility.SnakeCommand.PlaySnake();
}
public void ProcessAlias(string args)
{
if (string.IsNullOrWhiteSpace(args))

242
shell/UsageGenerator.cs Normal file
View File

@@ -0,0 +1,242 @@
using System;
using System.Collections.Generic;
namespace CMLeonOS
{
public class UsageGenerator
{
public class CommandInfo
{
public string Command { get; set; }
public List<SubCommandInfo> SubCommands { get; set; } = new List<SubCommandInfo>();
public string Description { get; set; }
public bool IsOptional { get; set; }
}
public class SubCommandInfo
{
public string Command { get; set; }
public string Description { get; set; }
public bool IsOptional { get; set; }
}
public static string GenerateUsage(string commandName, List<CommandInfo> commandInfos)
{
List<string> lines = new List<string>();
lines.Add("Usage: " + commandName + " [subcommand] [args]");
lines.Add("");
foreach (var commandInfo in commandInfos)
{
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
string commandLine = " " + commandName + " " + cmdDisplay;
if (!string.IsNullOrEmpty(commandInfo.Description))
{
int padding = 50 - commandLine.Length;
if (padding < 1) padding = 1;
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
}
lines.Add(commandLine);
if (commandInfo.SubCommands.Count > 0)
{
foreach (var subCommand in commandInfo.SubCommands)
{
string subCmdDisplay = subCommand.IsOptional ? "[" + subCommand.Command + "]" : subCommand.Command;
string subCommandLine = " " + commandName + " " + commandInfo.Command + " " + subCmdDisplay;
if (!string.IsNullOrEmpty(subCommand.Description))
{
int padding = 50 - subCommandLine.Length;
if (padding < 1) padding = 1;
subCommandLine += new string(' ', padding) + "- " + subCommand.Description;
}
lines.Add(subCommandLine);
}
}
}
return BuildStringList(lines);
}
public static string GenerateSimpleUsage(string commandName, string usagePattern)
{
return "Usage: " + commandName + " " + usagePattern;
}
public static string GenerateMultiLineUsage(string commandName, List<CommandInfo> commandInfos)
{
List<string> lines = new List<string>();
lines.Add("Usage: " + commandName + " [subcommand] [args]");
lines.Add("");
foreach (var commandInfo in commandInfos)
{
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
string commandLine = " " + commandName + " " + cmdDisplay;
if (!string.IsNullOrEmpty(commandInfo.Description))
{
int padding = 50 - commandLine.Length;
if (padding < 1) padding = 1;
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
}
lines.Add(commandLine);
}
return BuildStringList(lines);
}
public static string GenerateDetailedUsage(string commandName, List<CommandInfo> commandInfos)
{
List<string> lines = new List<string>();
lines.Add("Usage: " + commandName + " [subcommand] [args]");
lines.Add("");
lines.Add("Available subcommands:");
lines.Add("");
foreach (var commandInfo in commandInfos)
{
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
string commandLine = " " + cmdDisplay;
if (!string.IsNullOrEmpty(commandInfo.Description))
{
int padding = 30 - commandLine.Length;
if (padding < 1) padding = 1;
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
}
lines.Add(commandLine);
if (commandInfo.SubCommands.Count > 0)
{
lines.Add("");
lines.Add(" " + commandInfo.Command + " options:");
lines.Add("");
foreach (var subCommand in commandInfo.SubCommands)
{
string subCmdDisplay = subCommand.IsOptional ? "[" + subCommand.Command + "]" : subCommand.Command;
string subCommandLine = " " + subCmdDisplay;
if (!string.IsNullOrEmpty(subCommand.Description))
{
int padding = 30 - subCommandLine.Length;
if (padding < 1) padding = 1;
subCommandLine += new string(' ', padding) + "- " + subCommand.Description;
}
lines.Add(subCommandLine);
}
lines.Add("");
}
}
return BuildStringList(lines);
}
public static string GenerateCompactUsage(string commandName, List<CommandInfo> commandInfos)
{
List<string> lines = new List<string>();
string commandPattern = BuildCommandPattern(commandInfos);
lines.Add("Usage: " + commandName + " <" + commandPattern + "> [args]");
lines.Add("");
int maxCommandLength = FindMaxCommandLength(commandInfos);
foreach (var commandInfo in commandInfos)
{
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
string commandLine = " " + cmdDisplay;
if (!string.IsNullOrEmpty(commandInfo.Description))
{
int padding = maxCommandLength + 4 - commandLine.Length;
if (padding < 1) padding = 1;
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
}
lines.Add(commandLine);
}
return BuildStringList(lines);
}
public static string GenerateVerticalUsage(string commandName, List<CommandInfo> commandInfos)
{
List<string> lines = new List<string>();
lines.Add("Usage: " + commandName + " [subcommand] [args]");
lines.Add("");
lines.Add("Available subcommands:");
lines.Add("");
foreach (var commandInfo in commandInfos)
{
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
lines.Add(" " + cmdDisplay);
if (!string.IsNullOrEmpty(commandInfo.Description))
{
lines.Add(" " + commandInfo.Description);
}
if (commandInfo.SubCommands.Count > 0)
{
lines.Add(" Options:");
foreach (var subCommand in commandInfo.SubCommands)
{
string subCmdDisplay = subCommand.IsOptional ? "[" + subCommand.Command + "]" : subCommand.Command;
lines.Add(" " + subCmdDisplay);
if (!string.IsNullOrEmpty(subCommand.Description))
{
lines.Add(" " + subCommand.Description);
}
}
}
lines.Add("");
}
return BuildStringList(lines);
}
private static string BuildCommandPattern(List<CommandInfo> commandInfos)
{
string result = "";
for (int i = 0; i < commandInfos.Count; i++)
{
if (i > 0)
{
result += " | ";
}
string cmdDisplay = commandInfos[i].IsOptional ? "[" + commandInfos[i].Command + "]" : commandInfos[i].Command;
result += cmdDisplay;
}
return result;
}
private static int FindMaxCommandLength(List<CommandInfo> commandInfos)
{
int maxLen = 0;
foreach (var commandInfo in commandInfos)
{
int len = commandInfo.Command.Length;
if (len > maxLen)
{
maxLen = len;
}
}
return maxLen;
}
private static string BuildStringList(List<string> lines)
{
string result = "";
for (int i = 0; i < lines.Count; i++)
{
if (i > 0)
{
result += "\n";
}
result += lines[i];
}
return result;
}
}
}

View File

@@ -8,6 +8,7 @@ namespace CMLeonOS
public static string Minor = "0";
public static string Patch = "0";
public static string VersionType = "PreRelease";
public static string GitCommit = "unknown";
public static string FullVersion
{
@@ -23,5 +24,10 @@ namespace CMLeonOS
{
get { return $"CMLeonOS v{ShortVersion} ({VersionType})"; }
}
public static string DisplayVersionWithGit
{
get { return $"CMLeonOS v{ShortVersion} ({VersionType}) - Git: {GitCommit}"; }
}
}
}