mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
Compare commits
29 Commits
ce6d741059
...
1.0.0-prer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec7e0978d3 | ||
|
|
c5fc081977 | ||
|
|
58df162054 | ||
|
|
02ff8295ef | ||
|
|
b67e0e7a03 | ||
|
|
fefb7e737a | ||
|
|
c83988458a | ||
|
|
ffbc58eb40 | ||
|
|
c1e0651e4b | ||
|
|
5f4d97729a | ||
|
|
e8e45ef7ae | ||
|
|
2e8ef4ef91 | ||
|
|
0724502225 | ||
|
|
87d30be421 | ||
|
|
9c52f9288b | ||
|
|
969384d25f | ||
|
|
9b783e057a | ||
|
|
14149aab9d | ||
|
|
e0e7da7ac2 | ||
|
|
0386511a00 | ||
|
|
01476795ff | ||
|
|
8e60a49f10 | ||
|
|
f3226eb2ea | ||
|
|
82ecd84a35 | ||
|
|
6107ecc2db | ||
|
|
f19cad7f3a | ||
|
|
269c61ffdb | ||
|
|
b80c5b45a3 | ||
|
|
b36e3badb8 |
160
.VSCodeCounter/2026-02-11_18-21-42/details.md
Normal file
160
.VSCodeCounter/2026-02-11_18-21-42/details.md
Normal file
@@ -0,0 +1,160 @@
|
||||
# Details
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 145 files, 50173 codes, 1262 comments, 5030 blanks, all 56465 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 |
|
||||
| [Build.bat](/Build.bat) | Batch | 1 | 1 | 0 | 2 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 84 | 1 | 14 | 99 |
|
||||
| [Editor/Editor.cs](/Editor/Editor.cs) | C# | 267 | 29 | 35 | 331 |
|
||||
| [Editor/Nano.cs](/Editor/Nano.cs) | C# | 727 | 16 | 93 | 836 |
|
||||
| [GenerateGitCommit.ps1](/GenerateGitCommit.ps1) | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| [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# | 309 | 0 | 49 | 358 |
|
||||
| [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# | 349 | 63 | 67 | 479 |
|
||||
| [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 |
|
||||
| [LuaApps.cs](/LuaApps.cs) | C# | 13 | 0 | 3 | 16 |
|
||||
| [LuaApps/calculator.lua](/LuaApps/calculator.lua) | Lua | 87 | 0 | 11 | 98 |
|
||||
| [LuaApps/helloworld.lua](/LuaApps/helloworld.lua) | Lua | 3 | 0 | 0 | 3 |
|
||||
| [LuaApps/testspeed.lua](/LuaApps/testspeed.lua) | Lua | 6 | 1 | 0 | 7 |
|
||||
| [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# | 223 | 0 | 1 | 224 |
|
||||
| [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# | 175 | 0 | 10 | 185 |
|
||||
| [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# | 60 | 0 | 6 | 66 |
|
||||
| [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# | 531 | 0 | 26 | 557 |
|
||||
| [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# | 17 | 0 | 2 | 19 |
|
||||
| [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# | 42 | 0 | 6 | 48 |
|
||||
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 54 | 0 | 9 | 63 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 181 | 0 | 22 | 203 |
|
||||
| [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/TestTUICommand.cs](/Shell/Commands/TestTUICommand.cs) | C# | 583 | 0 | 102 | 685 |
|
||||
| [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# | 27 | 0 | 4 | 31 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 97 | 0 | 12 | 109 |
|
||||
| [Shell/Commands/Utility/AliasCommand.cs](/Shell/Commands/Utility/AliasCommand.cs) | C# | 140 | 0 | 19 | 159 |
|
||||
| [Shell/Commands/Utility/AppManagerCommand.cs](/Shell/Commands/Utility/AppManagerCommand.cs) | C# | 165 | 0 | 30 | 195 |
|
||||
| [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# | 89 | 0 | 12 | 101 |
|
||||
| [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/CalcGuiCommand.cs](/Shell/Commands/Utility/CalcGuiCommand.cs) | C# | 307 | 0 | 28 | 335 |
|
||||
| [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/MatrixCommand.cs](/Shell/Commands/Utility/MatrixCommand.cs) | C# | 62 | 0 | 13 | 75 |
|
||||
| [Shell/Commands/Utility/PromptCommand.cs](/Shell/Commands/Utility/PromptCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Commands/Utility/SnakeCommand.cs](/Shell/Commands/Utility/SnakeCommand.cs) | C# | 164 | 0 | 27 | 191 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 1,537 | 23 | 278 | 1,838 |
|
||||
| [Shell/UsageGenerator.cs](/Shell/UsageGenerator.cs) | C# | 211 | 0 | 31 | 242 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 404 | 21 | 40 | 465 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 691 | 11 | 104 | 806 |
|
||||
| [UI/CUI.cs](/UI/CUI.cs) | C# | 122 | 8 | 28 | 158 |
|
||||
| [UI/Components.cs](/UI/Components.cs) | C# | 960 | 0 | 144 | 1,104 |
|
||||
| [UI/TUI.cs](/UI/TUI.cs) | C# | 260 | 2 | 42 | 304 |
|
||||
| [UI/TUIDemo.cs](/UI/TUIDemo.cs) | C# | 279 | 0 | 54 | 333 |
|
||||
| [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# | 28 | 0 | 6 | 34 |
|
||||
| [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-ByTdGTSm.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js) | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js) | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf\_W.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf_W.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3\_L4TJjQ.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3_L4TJjQ.js) | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| [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 | 192 | 0 | 4 | 196 |
|
||||
| [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 | 342 | 0 | 4 | 346 |
|
||||
| [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 | 675 | 0 | 201 | 876 |
|
||||
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 16 | 0 | 4 | 20 |
|
||||
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 996 | 0 | 356 | 1,352 |
|
||||
| [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)
|
||||
65
.VSCodeCounter/2026-02-11_18-21-42/diff-details.md
Normal file
65
.VSCodeCounter/2026-02-11_18-21-42/diff-details.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# Diff Details
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 50 files, 3842 codes, 27 comments, 588 blanks, all 4457 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [Build.bat](/Build.bat) | Batch | 1 | 1 | 0 | 2 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 35 | 0 | 8 | 43 |
|
||||
| [GenerateGitCommit.ps1](/GenerateGitCommit.ps1) | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 103 | 0 | 17 | 120 |
|
||||
| [Kernel.cs](/Kernel.cs) | C# | 121 | 30 | 24 | 175 |
|
||||
| [LuaApps.cs](/LuaApps.cs) | C# | 13 | 0 | 3 | 16 |
|
||||
| [LuaApps/calculator.lua](/LuaApps/calculator.lua) | Lua | 87 | 0 | 11 | 98 |
|
||||
| [LuaApps/helloworld.lua](/LuaApps/helloworld.lua) | Lua | 3 | 0 | 0 | 3 |
|
||||
| [LuaApps/testspeed.lua](/LuaApps/testspeed.lua) | Lua | 6 | 1 | 0 | 7 |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 15 | 0 | 0 | 15 |
|
||||
| [Shell/Commands/Environment/EnvCommand.cs](/Shell/Commands/Environment/EnvCommand.cs) | C# | 68 | 0 | 2 | 70 |
|
||||
| [Shell/Commands/FileSystem/RmCommand.cs](/Shell/Commands/FileSystem/RmCommand.cs) | C# | 18 | 0 | 1 | 19 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 24 | 0 | 0 | 24 |
|
||||
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 1 | 0 | 0 | 1 |
|
||||
| [Shell/Commands/Script/BransweCommand.cs](/Shell/Commands/Script/BransweCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 16 | 0 | 1 | 17 |
|
||||
| [Shell/Commands/TestTUICommand.cs](/Shell/Commands/TestTUICommand.cs) | C# | 583 | 0 | 102 | 685 |
|
||||
| [Shell/Commands/User/HostnameCommand.cs](/Shell/Commands/User/HostnameCommand.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 23 | 0 | 1 | 24 |
|
||||
| [Shell/Commands/Utility/AppManagerCommand.cs](/Shell/Commands/Utility/AppManagerCommand.cs) | C# | 165 | 0 | 30 | 195 |
|
||||
| [Shell/Commands/Utility/Base64Command.cs](/Shell/Commands/Utility/Base64Command.cs) | C# | 31 | 0 | 2 | 33 |
|
||||
| [Shell/Commands/Utility/CalcGuiCommand.cs](/Shell/Commands/Utility/CalcGuiCommand.cs) | C# | 307 | 0 | 28 | 335 |
|
||||
| [Shell/Commands/Utility/MatrixCommand.cs](/Shell/Commands/Utility/MatrixCommand.cs) | C# | 62 | 0 | 13 | 75 |
|
||||
| [Shell/Commands/Utility/SnakeCommand.cs](/Shell/Commands/Utility/SnakeCommand.cs) | C# | 164 | 0 | 27 | 191 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 79 | 0 | 13 | 92 |
|
||||
| [Shell/UsageGenerator.cs](/Shell/UsageGenerator.cs) | C# | 211 | 0 | 31 | 242 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 4 | 4 | 0 | 8 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 8 | -11 | -1 | -4 |
|
||||
| [UI/Components.cs](/UI/Components.cs) | C# | 960 | 0 | 144 | 1,104 |
|
||||
| [UI/TUI.cs](/UI/TUI.cs) | C# | 260 | 2 | 42 | 304 |
|
||||
| [UI/TUIDemo.cs](/UI/TUIDemo.cs) | C# | 279 | 0 | 54 | 333 |
|
||||
| [Utils/Version.cs](/Utils/Version.cs) | C# | 5 | 0 | 1 | 6 |
|
||||
| [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-ByTdGTSm.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.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-C1vKFkGc.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.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/commands.html-DsR2axk8.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js) | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.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-BMbDjf\_W.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf_W.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-3\_L4TJjQ.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3_L4TJjQ.js) | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| [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 | 10 | 0 | 0 | 10 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/lua.html](/docs/cmleonos/docs/.vuepress/dist/lua.html) | HTML | 6 | 0 | 0 | 6 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 46 | 0 | 10 | 56 |
|
||||
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 2 | 0 | 1 | 3 |
|
||||
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 56 | 0 | 17 | 73 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
52
.VSCodeCounter/2026-02-11_18-21-42/diff.csv
Normal file
52
.VSCodeCounter/2026-02-11_18-21-42/diff.csv
Normal file
@@ -0,0 +1,52 @@
|
||||
"filename", "language", "C#", "PowerShell", "Batch", "XML", "Lua", "Markdown", "HTML", "JavaScript", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat", "Batch", 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 35, 0, 0, 0, 0, 0, 8, 43
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1", "PowerShell", 0, 22, 0, 0, 0, 0, 0, 0, 0, 3, 25
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 103, 0, 0, 0, 0, 0, 0, 0, 0, 17, 120
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 121, 0, 0, 0, 0, 0, 0, 0, 30, 24, 175
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua", "Lua", 0, 0, 0, 0, 87, 0, 0, 0, 0, 11, 98
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua", "Lua", 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua", "Lua", 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 7
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 68, 0, 0, 0, 0, 0, 0, 0, 0, 2, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 1, 19
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs", "C#", 583, 0, 0, 0, 0, 0, 0, 0, 0, 102, 685
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 23, 0, 0, 0, 0, 0, 0, 0, 0, 1, 24
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 30, 195
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 31, 0, 0, 0, 0, 0, 0, 0, 0, 2, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs", "C#", 307, 0, 0, 0, 0, 0, 0, 0, 0, 28, 335
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 13, 75
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs", "C#", 164, 0, 0, 0, 0, 0, 0, 0, 0, 27, 191
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 79, 0, 0, 0, 0, 0, 0, 0, 0, 13, 92
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs", "C#", 211, 0, 0, 0, 0, 0, 0, 0, 0, 31, 242
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 8
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 8, 0, 0, 0, 0, 0, 0, 0, -11, -1, -4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs", "C#", 960, 0, 0, 0, 0, 0, 0, 0, 0, 144, 1104
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs", "C#", 260, 0, 0, 0, 0, 0, 0, 0, 2, 42, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs", "C#", 279, 0, 0, 0, 0, 0, 0, 0, 0, 54, 333
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6
|
||||
"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, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js", "JavaScript", 0, 0, 0, 0, 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, 0, 0, 0, 0, -28, -4, -1, -33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 28, 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, 0, -143, 0, -1, -144
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 153, 0, 1, 154
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js", "JavaScript", 0, 0, 0, 0, 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, 0, 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js", "JavaScript", 0, 0, 0, 0, 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, 0, 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 303, 0, 1, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -297, 0, -1, -298
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html", "HTML", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 6
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 0, 0, 0, 0, 46, 0, 0, 0, 10, 56
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 0, 0, 0, 0, 56, 0, 0, 0, 17, 73
|
||||
"Total", "-", 3552, 22, 1, 35, 96, 104, 16, 16, 27, 588, 4457
|
||||
|
54
.VSCodeCounter/2026-02-11_18-21-42/diff.md
Normal file
54
.VSCodeCounter/2026-02-11_18-21-42/diff.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Diff Summary
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 50 files, 3842 codes, 27 comments, 588 blanks, all 4457 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 27 | 3,552 | 25 | 538 | 4,115 |
|
||||
| Markdown | 3 | 104 | 0 | 28 | 132 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 35 | 0 | 8 | 43 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| HTML | 2 | 16 | 0 | 0 | 16 |
|
||||
| JavaScript | 12 | 16 | 0 | 0 | 16 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 50 | 3,842 | 27 | 588 | 4,457 |
|
||||
| . (Files) | 5 | 192 | 31 | 38 | 261 |
|
||||
| Interpreter | 1 | 103 | 0 | 17 | 120 |
|
||||
| Interpreter\\UniLua | 1 | 103 | 0 | 17 | 120 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Shell | 18 | 1,799 | 0 | 254 | 2,053 |
|
||||
| Shell (Files) | 3 | 305 | 0 | 44 | 349 |
|
||||
| Shell\\Commands | 15 | 1,494 | 0 | 210 | 1,704 |
|
||||
| Shell\\Commands (Files) | 1 | 583 | 0 | 102 | 685 |
|
||||
| Shell\\Commands\\Environment | 1 | 68 | 0 | 2 | 70 |
|
||||
| Shell\\Commands\\FileSystem | 1 | 18 | 0 | 1 | 19 |
|
||||
| Shell\\Commands\\Help | 1 | 24 | 0 | 0 | 24 |
|
||||
| Shell\\Commands\\Info | 1 | 1 | 0 | 0 | 1 |
|
||||
| Shell\\Commands\\Script | 3 | 37 | 0 | 3 | 40 |
|
||||
| Shell\\Commands\\User | 2 | 34 | 0 | 2 | 36 |
|
||||
| Shell\\Commands\\Utility | 5 | 729 | 0 | 100 | 829 |
|
||||
| System | 2 | 12 | -7 | -1 | 4 |
|
||||
| UI | 3 | 1,499 | 2 | 240 | 1,741 |
|
||||
| Utils | 1 | 5 | 0 | 1 | 6 |
|
||||
| docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\\cmleonos | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\\cmleonos\\docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\\cmleonos\\docs (Files) | 3 | 104 | 0 | 28 | 132 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 2 | 16 | 0 | 0 | 16 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 12 | 16 | 0 | 0 | 16 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
107
.VSCodeCounter/2026-02-11_18-21-42/diff.txt
Normal file
107
.VSCodeCounter/2026-02-11_18-21-42/diff.txt
Normal file
@@ -0,0 +1,107 @@
|
||||
Date : 2026-02-11 18:21:42
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 50 files, 3842 codes, 27 comments, 588 blanks, all 4457 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 27 | 3,552 | 25 | 538 | 4,115 |
|
||||
| Markdown | 3 | 104 | 0 | 28 | 132 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 35 | 0 | 8 | 43 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| HTML | 2 | 16 | 0 | 0 | 16 |
|
||||
| JavaScript | 12 | 16 | 0 | 0 | 16 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 50 | 3,842 | 27 | 588 | 4,457 |
|
||||
| . (Files) | 5 | 192 | 31 | 38 | 261 |
|
||||
| Interpreter | 1 | 103 | 0 | 17 | 120 |
|
||||
| Interpreter\UniLua | 1 | 103 | 0 | 17 | 120 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Shell | 18 | 1,799 | 0 | 254 | 2,053 |
|
||||
| Shell (Files) | 3 | 305 | 0 | 44 | 349 |
|
||||
| Shell\Commands | 15 | 1,494 | 0 | 210 | 1,704 |
|
||||
| Shell\Commands (Files) | 1 | 583 | 0 | 102 | 685 |
|
||||
| Shell\Commands\Environment | 1 | 68 | 0 | 2 | 70 |
|
||||
| Shell\Commands\FileSystem | 1 | 18 | 0 | 1 | 19 |
|
||||
| Shell\Commands\Help | 1 | 24 | 0 | 0 | 24 |
|
||||
| Shell\Commands\Info | 1 | 1 | 0 | 0 | 1 |
|
||||
| Shell\Commands\Script | 3 | 37 | 0 | 3 | 40 |
|
||||
| Shell\Commands\User | 2 | 34 | 0 | 2 | 36 |
|
||||
| Shell\Commands\Utility | 5 | 729 | 0 | 100 | 829 |
|
||||
| System | 2 | 12 | -7 | -1 | 4 |
|
||||
| UI | 3 | 1,499 | 2 | 240 | 1,741 |
|
||||
| Utils | 1 | 5 | 0 | 1 | 6 |
|
||||
| docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\cmleonos | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\cmleonos\docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\cmleonos\docs (Files) | 3 | 104 | 0 | 28 | 132 |
|
||||
| docs\cmleonos\docs\.vuepress | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\cmleonos\docs\.vuepress\dist | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 2 | 16 | 0 | 0 | 16 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 12 | 16 | 0 | 0 | 16 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat | Batch | 1 | 1 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 35 | 0 | 8 | 43 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1 | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 103 | 0 | 17 | 120 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 121 | 30 | 24 | 175 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs | C# | 13 | 0 | 3 | 16 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua | Lua | 87 | 0 | 11 | 98 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua | Lua | 3 | 0 | 0 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua | Lua | 6 | 1 | 0 | 7 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 15 | 0 | 0 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs | C# | 68 | 0 | 2 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs | C# | 18 | 0 | 1 | 19 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 24 | 0 | 0 | 24 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 1 | 0 | 0 | 1 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 16 | 0 | 1 | 17 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs | C# | 583 | 0 | 102 | 685 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 23 | 0 | 1 | 24 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs | C# | 165 | 0 | 30 | 195 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs | C# | 31 | 0 | 2 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs | C# | 307 | 0 | 28 | 335 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs | C# | 62 | 0 | 13 | 75 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs | C# | 164 | 0 | 27 | 191 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 79 | 0 | 13 | 92 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs | C# | 211 | 0 | 31 | 242 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 4 | 4 | 0 | 8 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 8 | -11 | -1 | -4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs | C# | 960 | 0 | 144 | 1,104 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs | C# | 260 | 2 | 42 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs | C# | 279 | 0 | 54 | 333 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs | C# | 5 | 0 | 1 | 6 |
|
||||
| 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-ByTdGTSm.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-C1vKFkGc.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\commands.html-DsR2axk8.js | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.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-BMbDjf_W.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-3_L4TJjQ.js | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| 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 | 10 | 0 | 0 | 10 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html | HTML | 6 | 0 | 0 | 6 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 46 | 0 | 10 | 56 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 2 | 0 | 1 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 56 | 0 | 17 | 73 |
|
||||
| Total | | 3,842 | 27 | 588 | 4,457 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
147
.VSCodeCounter/2026-02-11_18-21-42/results.csv
Normal file
147
.VSCodeCounter/2026-02-11_18-21-42/results.csv
Normal file
@@ -0,0 +1,147 @@
|
||||
"filename", "language", "C#", "JSON", "PowerShell", "Batch", "Markdown", "XML", "Lua", "HTML", "YAML", "JavaScript", "PostCSS", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md", "Markdown", 0, 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, 67, 328
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat", "Batch", 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 1, 14, 99
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs", "C#", 267, 0, 0, 0, 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, 0, 0, 0, 16, 93, 836
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1", "PowerShell", 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs", "C#", 482, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 1, 52, 420
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 358
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs", "C#", 256, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 58, 161, 1257
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 67, 479
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md", "Markdown", 0, 0, 0, 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, 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, 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, 0, 0, 0, 18, 112
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua", "Lua", 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 11, 98
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua", "Lua", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua", "Lua", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 1, 0, 7
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md", "Markdown", 0, 0, 0, 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, 0, 0, 0, 17, 157
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 224
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs", "C#", 24, 0, 0, 0, 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, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 185
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs", "C#", 18, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 9, 57
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 66
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs", "C#", 27, 0, 0, 0, 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, 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, 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, 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, 0, 0, 0, 6, 51
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 557
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 19
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 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, 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, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 63
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 203
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs", "C#", 11, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 9, 86
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs", "C#", 583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 685
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 31
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 109
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 159
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 195
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs", "C#", 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 117
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 101
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs", "C#", 11, 0, 0, 0, 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, 0, 0, 0, 4, 60
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs", "C#", 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 335
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs", "C#", 57, 0, 0, 0, 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, 0, 0, 0, 2, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 75
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs", "C#", 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 191
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 1537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 278, 1838
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs", "C#", 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 242
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 40, 465
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 104, 806
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs", "C#", 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 28, 158
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs", "C#", 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 1104
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs", "C#", 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 42, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs", "C#", 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 333
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs", "C#", 86, 0, 0, 0, 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, 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, 0, 0, 0, 16, 127
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 41, 226
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 34
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js", "JavaScript", 0, 0, 0, 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, 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, 37, 0, 0, 0, 0, 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, 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, 3, 0, 0, 0, 0, 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, 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, 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, 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, 0, 0, 40, 0, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js", "JavaScript", 0, 0, 0, 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-C1vKFkGc.js", "JavaScript", 0, 0, 0, 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-DsR2axk8.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 1, 154
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js", "JavaScript", 0, 0, 0, 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-BMbDjf_W.js", "JavaScript", 0, 0, 0, 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-3_L4TJjQ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, 1, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css", "PostCSS", 0, 0, 0, 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, 0, 0, 192, 0, 0, 0, 0, 4, 196
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 40, 0, 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, 0, 0, 40, 0, 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, 0, 0, 342, 0, 0, 0, 0, 4, 346
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md", "Markdown", 0, 0, 0, 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, 0, 0, 0, 675, 0, 0, 0, 0, 0, 0, 0, 201, 876
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 4, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 0, 0, 0, 996, 0, 0, 0, 0, 0, 0, 0, 356, 1352
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json", "JSON", 0, 20, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2410, 0, 0, 0, 674, 3084
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json", "JSON", 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6
|
||||
"Total", "-", 24083, 66, 22, 1, 2468, 84, 96, 654, 2410, 20288, 1, 1262, 5030, 56465
|
||||
|
1
.VSCodeCounter/2026-02-11_18-21-42/results.json
Normal file
1
.VSCodeCounter/2026-02-11_18-21-42/results.json
Normal file
File diff suppressed because one or more lines are too long
68
.VSCodeCounter/2026-02-11_18-21-42/results.md
Normal file
68
.VSCodeCounter/2026-02-11_18-21-42/results.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Summary
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 145 files, 50173 codes, 1262 comments, 5030 blanks, all 56465 lines
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 109 | 24,083 | 844 | 3,529 | 28,456 |
|
||||
| JavaScript | 12 | 20,288 | 415 | 34 | 20,737 |
|
||||
| Markdown | 7 | 2,468 | 0 | 742 | 3,210 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| HTML | 5 | 654 | 0 | 20 | 674 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 84 | 1 | 14 | 99 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 145 | 50,173 | 1,262 | 5,030 | 56,465 |
|
||||
| . (Files) | 9 | 1,223 | 65 | 264 | 1,552 |
|
||||
| Editor | 2 | 994 | 45 | 128 | 1,167 |
|
||||
| Interpreter | 34 | 13,160 | 604 | 1,957 | 15,721 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\\UniLua | 33 | 12,678 | 576 | 1,904 | 15,158 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Settings | 1 | 140 | 0 | 17 | 157 |
|
||||
| Shell | 56 | 6,010 | 23 | 819 | 6,852 |
|
||||
| Shell (Files) | 3 | 1,971 | 23 | 310 | 2,304 |
|
||||
| Shell\\Commands | 53 | 4,039 | 0 | 509 | 4,548 |
|
||||
| Shell\\Commands (Files) | 3 | 884 | 0 | 135 | 1,019 |
|
||||
| Shell\\Commands\\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\\Commands\\Environment | 1 | 175 | 0 | 10 | 185 |
|
||||
| Shell\\Commands\\FileSystem | 17 | 580 | 0 | 85 | 665 |
|
||||
| Shell\\Commands\\Help | 1 | 531 | 0 | 26 | 557 |
|
||||
| Shell\\Commands\\Info | 2 | 29 | 0 | 4 | 33 |
|
||||
| Shell\\Commands\\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\\Commands\\Script | 3 | 277 | 0 | 37 | 314 |
|
||||
| Shell\\Commands\\System | 7 | 163 | 0 | 24 | 187 |
|
||||
| Shell\\Commands\\User | 3 | 134 | 0 | 17 | 151 |
|
||||
| Shell\\Commands\\Utility | 12 | 1,192 | 0 | 161 | 1,353 |
|
||||
| System | 2 | 1,095 | 32 | 144 | 1,271 |
|
||||
| UI | 4 | 1,621 | 10 | 268 | 1,899 |
|
||||
| Utils | 5 | 555 | 67 | 102 | 724 |
|
||||
| docs | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\\cmleonos | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\\cmleonos\\docs | 24 | 22,703 | 415 | 621 | 23,739 |
|
||||
| docs\\cmleonos\\docs (Files) | 4 | 1,720 | 0 | 565 | 2,285 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 20 | 20,983 | 415 | 56 | 21,454 |
|
||||
| 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,142 | 4 | 27 | 1,173 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 5 | 654 | 0 | 20 | 674 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 7 | 488 | 4 | 7 | 499 |
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
216
.VSCodeCounter/2026-02-11_18-21-42/results.txt
Normal file
216
.VSCodeCounter/2026-02-11_18-21-42/results.txt
Normal file
@@ -0,0 +1,216 @@
|
||||
Date : 2026-02-11 18:21:42
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 145 files, 50173 codes, 1262 comments, 5030 blanks, all 56465 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 109 | 24,083 | 844 | 3,529 | 28,456 |
|
||||
| JavaScript | 12 | 20,288 | 415 | 34 | 20,737 |
|
||||
| Markdown | 7 | 2,468 | 0 | 742 | 3,210 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| HTML | 5 | 654 | 0 | 20 | 674 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 84 | 1 | 14 | 99 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 145 | 50,173 | 1,262 | 5,030 | 56,465 |
|
||||
| . (Files) | 9 | 1,223 | 65 | 264 | 1,552 |
|
||||
| Editor | 2 | 994 | 45 | 128 | 1,167 |
|
||||
| Interpreter | 34 | 13,160 | 604 | 1,957 | 15,721 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\UniLua | 33 | 12,678 | 576 | 1,904 | 15,158 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Settings | 1 | 140 | 0 | 17 | 157 |
|
||||
| Shell | 56 | 6,010 | 23 | 819 | 6,852 |
|
||||
| Shell (Files) | 3 | 1,971 | 23 | 310 | 2,304 |
|
||||
| Shell\Commands | 53 | 4,039 | 0 | 509 | 4,548 |
|
||||
| Shell\Commands (Files) | 3 | 884 | 0 | 135 | 1,019 |
|
||||
| Shell\Commands\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\Commands\Environment | 1 | 175 | 0 | 10 | 185 |
|
||||
| Shell\Commands\FileSystem | 17 | 580 | 0 | 85 | 665 |
|
||||
| Shell\Commands\Help | 1 | 531 | 0 | 26 | 557 |
|
||||
| Shell\Commands\Info | 2 | 29 | 0 | 4 | 33 |
|
||||
| Shell\Commands\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\Commands\Script | 3 | 277 | 0 | 37 | 314 |
|
||||
| Shell\Commands\System | 7 | 163 | 0 | 24 | 187 |
|
||||
| Shell\Commands\User | 3 | 134 | 0 | 17 | 151 |
|
||||
| Shell\Commands\Utility | 12 | 1,192 | 0 | 161 | 1,353 |
|
||||
| System | 2 | 1,095 | 32 | 144 | 1,271 |
|
||||
| UI | 4 | 1,621 | 10 | 268 | 1,899 |
|
||||
| Utils | 5 | 555 | 67 | 102 | 724 |
|
||||
| docs | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\cmleonos | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\cmleonos\docs | 24 | 22,703 | 415 | 621 | 23,739 |
|
||||
| docs\cmleonos\docs (Files) | 4 | 1,720 | 0 | 565 | 2,285 |
|
||||
| docs\cmleonos\docs\.vuepress | 20 | 20,983 | 415 | 56 | 21,454 |
|
||||
| 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,142 | 4 | 27 | 1,173 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 5 | 654 | 0 | 20 | 674 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 7 | 488 | 4 | 7 | 499 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
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\Build.bat | Batch | 1 | 1 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 84 | 1 | 14 | 99 |
|
||||
| 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\GenerateGitCommit.ps1 | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| 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# | 309 | 0 | 49 | 358 |
|
||||
| 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# | 349 | 63 | 67 | 479 |
|
||||
| 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\LuaApps.cs | C# | 13 | 0 | 3 | 16 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua | Lua | 87 | 0 | 11 | 98 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua | Lua | 3 | 0 | 0 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua | Lua | 6 | 1 | 0 | 7 |
|
||||
| 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# | 223 | 0 | 1 | 224 |
|
||||
| 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# | 175 | 0 | 10 | 185 |
|
||||
| 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# | 60 | 0 | 6 | 66 |
|
||||
| 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# | 531 | 0 | 26 | 557 |
|
||||
| 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# | 17 | 0 | 2 | 19 |
|
||||
| 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# | 42 | 0 | 6 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 54 | 0 | 9 | 63 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 181 | 0 | 22 | 203 |
|
||||
| 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\TestTUICommand.cs | C# | 583 | 0 | 102 | 685 |
|
||||
| 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# | 27 | 0 | 4 | 31 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 97 | 0 | 12 | 109 |
|
||||
| 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\AppManagerCommand.cs | C# | 165 | 0 | 30 | 195 |
|
||||
| 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# | 89 | 0 | 12 | 101 |
|
||||
| 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\CalcGuiCommand.cs | C# | 307 | 0 | 28 | 335 |
|
||||
| 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\MatrixCommand.cs | C# | 62 | 0 | 13 | 75 |
|
||||
| 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\Commands\Utility\SnakeCommand.cs | C# | 164 | 0 | 27 | 191 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 1,537 | 23 | 278 | 1,838 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs | C# | 211 | 0 | 31 | 242 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 404 | 21 | 40 | 465 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 691 | 11 | 104 | 806 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs | C# | 122 | 8 | 28 | 158 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs | C# | 960 | 0 | 144 | 1,104 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs | C# | 260 | 2 | 42 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs | C# | 279 | 0 | 54 | 333 |
|
||||
| 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# | 28 | 0 | 6 | 34 |
|
||||
| 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-ByTdGTSm.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| 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 | 192 | 0 | 4 | 196 |
|
||||
| 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 | 342 | 0 | 4 | 346 |
|
||||
| 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 | 675 | 0 | 201 | 876 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 16 | 0 | 4 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 996 | 0 | 356 | 1,352 |
|
||||
| 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 | | 50,173 | 1,262 | 5,030 | 56,465 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -56,3 +56,5 @@ coverage/
|
||||
|
||||
# Release files
|
||||
*.release
|
||||
|
||||
main.map
|
||||
157
BootMenu.cs
Normal file
157
BootMenu.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using Sys = Cosmos.System;
|
||||
using Cosmos.HAL;
|
||||
using Cosmos.Core;
|
||||
using System.Threading;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public enum BootMenuAction
|
||||
{
|
||||
NormalBoot,
|
||||
Reboot,
|
||||
Shutdown
|
||||
}
|
||||
|
||||
internal static class BootMenu
|
||||
{
|
||||
private static void PrintOption(string text, bool selected)
|
||||
{
|
||||
Console.SetCursorPosition(1, Console.GetCursorPosition().Top);
|
||||
|
||||
Console.BackgroundColor = selected ? ConsoleColor.White : ConsoleColor.Black;
|
||||
Console.ForegroundColor = selected ? ConsoleColor.Black : ConsoleColor.White;
|
||||
|
||||
Console.WriteLine(text);
|
||||
}
|
||||
|
||||
private static void Render(int selIdx, int remainingTime)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
|
||||
Console.SetCursorPosition(0, 0);
|
||||
|
||||
uint mem = Cosmos.Core.CPU.GetAmountOfRAM();
|
||||
Console.WriteLine($"{Version.DisplayVersion} [{mem} MB memory]");
|
||||
// 这里老显示 unknown,谁知道为啥
|
||||
// Console.WriteLine($"Git Commit: {Version.GitCommit}");
|
||||
Console.WriteLine($"Build Time: {GetBuildTime()}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Auto-select in {remainingTime} seconds...");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Select an option:");
|
||||
Console.WriteLine();
|
||||
|
||||
PrintOption("Normal Boot", selIdx == 0);
|
||||
PrintOption("Reboot", selIdx == 1);
|
||||
PrintOption("Shutdown", selIdx == 2);
|
||||
}
|
||||
|
||||
private static BootMenuAction Confirm(int selIdx)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
|
||||
Console.Clear();
|
||||
|
||||
Console.SetCursorPosition(0, 0);
|
||||
|
||||
Console.CursorVisible = true;
|
||||
|
||||
switch (selIdx)
|
||||
{
|
||||
case 0:
|
||||
return BootMenuAction.NormalBoot;
|
||||
case 1:
|
||||
Sys.Power.Reboot();
|
||||
return BootMenuAction.Reboot;
|
||||
case 2:
|
||||
Sys.Power.Shutdown();
|
||||
return BootMenuAction.Shutdown;
|
||||
default:
|
||||
return BootMenuAction.NormalBoot;
|
||||
}
|
||||
}
|
||||
|
||||
public static BootMenuAction Show()
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
|
||||
Console.Clear();
|
||||
|
||||
Console.CursorVisible = false;
|
||||
|
||||
int selIdx = 0;
|
||||
int remainingTime = 10;
|
||||
int counter = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
Render(selIdx, remainingTime);
|
||||
|
||||
if (Sys.KeyboardManager.TryReadKey(out var key))
|
||||
{
|
||||
if (key.Key == Sys.ConsoleKeyEx.Enter)
|
||||
{
|
||||
return Confirm(selIdx);
|
||||
}
|
||||
else if (key.Key == Sys.ConsoleKeyEx.DownArrow)
|
||||
{
|
||||
selIdx++;
|
||||
remainingTime = 10;
|
||||
counter = 0;
|
||||
}
|
||||
else if (key.Key == Sys.ConsoleKeyEx.UpArrow)
|
||||
{
|
||||
selIdx--;
|
||||
remainingTime = 10;
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
counter++;
|
||||
|
||||
if (counter >= 10)
|
||||
{
|
||||
remainingTime--;
|
||||
counter = 0;
|
||||
|
||||
if (remainingTime <= 0)
|
||||
{
|
||||
return Confirm(selIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selIdx < 0)
|
||||
{
|
||||
selIdx = 2;
|
||||
}
|
||||
|
||||
if (selIdx > 2)
|
||||
{
|
||||
selIdx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetBuildTime()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Kernel.buildTimeFile != null && Kernel.buildTimeFile.Length > 0)
|
||||
{
|
||||
return System.Text.Encoding.UTF8.GetString(Kernel.buildTimeFile);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
3
BuildTime.ps1
Normal file
3
BuildTime.ps1
Normal file
@@ -0,0 +1,3 @@
|
||||
$buildTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||
$buildTime | Out-File -FilePath "BuildTime.txt" -Encoding ASCII -NoNewline
|
||||
Write-Host "Build time written to BuildTime.txt: $buildTime"
|
||||
1
BuildTime.txt
Normal file
1
BuildTime.txt
Normal file
@@ -0,0 +1 @@
|
||||
2026-02-28 19:35:58
|
||||
@@ -20,15 +20,17 @@
|
||||
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
|
||||
<PxeInterface>192.168.0.8</PxeInterface>
|
||||
<CompressionType>Gzip</CompressionType>
|
||||
<BinFormat>Elf</BinFormat>
|
||||
<BinFormat>Bin</BinFormat>
|
||||
<DebugEnabled>False</DebugEnabled>
|
||||
<CompileVBEMultiboot>False</CompileVBEMultiboot>
|
||||
<RemoveBootDebugOutput>False</RemoveBootDebugOutput>
|
||||
<RemoveBootDebugOutput>True</RemoveBootDebugOutput>
|
||||
<CosmosDisableDebugger>true</CosmosDisableDebugger>
|
||||
<CosmosDebugLevel>None</CosmosDebugLevel>
|
||||
<OptimizationLevel>2</OptimizationLevel>
|
||||
<VBEResolution>800x600x32</VBEResolution>
|
||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||
<Timeout>1</Timeout>
|
||||
<UseUEFI>False</UseUEFI>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@@ -70,6 +72,7 @@
|
||||
<EmbeddedResource Include="font.psf" />
|
||||
<EmbeddedResource Include="Wallpapers\wallpaper.bmp" />
|
||||
<EmbeddedResource Include="GitCommit.txt" />
|
||||
<EmbeddedResource Include="BuildTime.txt" />
|
||||
<EmbeddedResource Include="LuaApps\*.lua" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -88,11 +91,12 @@
|
||||
<PackageReference Include="Cosmos.System2_Plugs" Version="0.1.0-localbuild20260201071815" />
|
||||
<PackageReference Include="CosmosFtpServer" Version="1.0.9" />
|
||||
<PackageReference Include="CosmosHttp" Version="1.0.4" />
|
||||
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260203125852" />
|
||||
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260225062300" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="powershell -ExecutionPolicy Bypass -File GenerateGitCommit.ps1" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
<Exec Command="powershell -ExecutionPolicy Bypass -File BuildTime.ps1" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1 +1 @@
|
||||
03b136f
|
||||
c5fc081
|
||||
145
Kernel.cs
145
Kernel.cs
@@ -28,9 +28,14 @@ namespace CMLeonOS
|
||||
|
||||
// 创建全局CosmosVFS实例
|
||||
public static Sys.FileSystem.CosmosVFS fs = new Sys.FileSystem.CosmosVFS();
|
||||
public static Shell shell;
|
||||
public static UserSystem userSystem;
|
||||
|
||||
public static void ExecuteCommand(string command)
|
||||
{
|
||||
var tempShell = new Shell(userSystem);
|
||||
tempShell.ExecuteCommand(command);
|
||||
}
|
||||
|
||||
public static bool FixMode = false;
|
||||
public static DateTime SystemStartTime;
|
||||
|
||||
@@ -43,6 +48,9 @@ namespace CMLeonOS
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.GitCommit.txt")]
|
||||
public static readonly byte[] gitCommitFile;
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.BuildTime.txt")]
|
||||
public static readonly byte[] buildTimeFile;
|
||||
|
||||
public static void ShowError(string message)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
@@ -52,26 +60,24 @@ namespace CMLeonOS
|
||||
|
||||
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}");
|
||||
// }
|
||||
BootMenuAction bootAction = BootMenu.Show();
|
||||
|
||||
Console.WriteLine("Kernel load done!");
|
||||
Console.WriteLine(@"-------------------------------------------------");
|
||||
switch (bootAction)
|
||||
{
|
||||
case BootMenuAction.Reboot:
|
||||
Sys.Power.Reboot();
|
||||
break;
|
||||
case BootMenuAction.Shutdown:
|
||||
Sys.Power.Shutdown();
|
||||
break;
|
||||
case BootMenuAction.NormalBoot:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Console.Clear();
|
||||
// Console.WriteLine("Kernel load done!");
|
||||
// Console.WriteLine(@"----------------------------------------------------------");
|
||||
Console.WriteLine(@" ____ __ __ _ ___ ____ ");
|
||||
Console.WriteLine(@" / ___| \/ | | ___ ___ _ __ / _ \/ ___| ");
|
||||
Console.WriteLine(@" | | | |\/| | | / _ \/ _ \| '_ \| | | \___ \ ");
|
||||
@@ -79,8 +85,8 @@ namespace CMLeonOS
|
||||
Console.WriteLine(@" \____|_| |_|_____\___|\___/|_| |_|____/|____/ ");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("The CMLeonOS Project");
|
||||
Console.WriteLine("By LeonOS 2 Developement Team");
|
||||
Console.WriteLine(@"-------------------------------------------------");
|
||||
Console.WriteLine("(C) LeonOS 2 Developer Team 2025-2026. All rights reserved.");
|
||||
Console.WriteLine(@"----------------------------------------------------------");
|
||||
|
||||
// 注册VFS
|
||||
_logger.Info("Kernel", "Starting VFS initialization");
|
||||
@@ -142,6 +148,24 @@ namespace CMLeonOS
|
||||
_logger.Warning("Kernel", "Git Commit file not found, using 'unknown'");
|
||||
}
|
||||
|
||||
// 读取 Build Time
|
||||
if (buildTimeFile != null && buildTimeFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
string buildTime = System.Text.Encoding.UTF8.GetString(buildTimeFile);
|
||||
_logger.Info("Kernel", $"Build Time: {buildTime}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Warning("Kernel", "Failed to read Build Time");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Warning("Kernel", "Build Time file not found");
|
||||
}
|
||||
|
||||
// 检查env.dat文件是否存在,如果不存在则创建并设置Test环境变量
|
||||
string envFilePath = @"0:\system\env.dat";
|
||||
if (!System.IO.File.Exists(envFilePath))
|
||||
@@ -229,12 +253,11 @@ namespace CMLeonOS
|
||||
|
||||
_logger.Info("Kernel", $"User '{userSystem.CurrentUsername}' logged in successfully");
|
||||
|
||||
// 登录成功后,初始化Shell
|
||||
shell = new Shell(userSystem);
|
||||
|
||||
// 检查并执行启动脚本
|
||||
ExecuteStartupScript();
|
||||
|
||||
ExecuteStartupTest();
|
||||
|
||||
if (System.IO.File.Exists("0:\\system\\zen"))
|
||||
{
|
||||
Console.WriteLine("=====================================");
|
||||
@@ -261,10 +284,14 @@ namespace CMLeonOS
|
||||
Console.WriteLine("A bug brings new wake, a line brings new shine.");
|
||||
}
|
||||
|
||||
// 运行Shell(用户可以输入exit退出)
|
||||
_logger.Info("Kernel", "Starting Shell");
|
||||
shell.Run();
|
||||
_logger.Info("Kernel", "Shell exited");
|
||||
// 运行Shell进程(用户可以输入exit退出)
|
||||
_logger.Info("Kernel", "Starting Shell process");
|
||||
var shellProcess = new ShellProcess(userSystem);
|
||||
ProcessManager.AddProcess(shellProcess);
|
||||
shellProcess.TryStart();
|
||||
shellProcess.TryRun();
|
||||
shellProcess.TryStop();
|
||||
_logger.Info("Kernel", "Shell process exited");
|
||||
|
||||
// 如果用户输入了exit,Shell.Run()会返回,继续循环
|
||||
}
|
||||
@@ -419,7 +446,10 @@ namespace CMLeonOS
|
||||
}
|
||||
|
||||
Console.WriteLine("Executing startup script...");
|
||||
Console.WriteLine("--------------------------------");
|
||||
// Console.WriteLine("--------------------------------");
|
||||
|
||||
// 创建临时 Shell 实例来执行启动脚本
|
||||
var tempShell = new Shell(userSystem);
|
||||
|
||||
// 逐行执行命令
|
||||
foreach (string line in lines)
|
||||
@@ -432,10 +462,10 @@ namespace CMLeonOS
|
||||
|
||||
// 执行命令
|
||||
// Console.WriteLine($"Executing: {line}");
|
||||
shell.ExecuteCommand(line);
|
||||
tempShell.ExecuteCommand(line);
|
||||
}
|
||||
|
||||
Console.WriteLine("--------------------------------");
|
||||
// Console.WriteLine("--------------------------------");
|
||||
_logger.Success("Kernel", "Startup script execution completed");
|
||||
}
|
||||
else
|
||||
@@ -452,6 +482,52 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteStartupTest()
|
||||
{
|
||||
Console.WriteLine("------------------------------------------------------");
|
||||
Console.WriteLine($"Welcome to {Version.DisplayVersion}");
|
||||
Console.WriteLine("* Documentation: https://cmleonos.jjmm.ink/");
|
||||
Console.WriteLine("* Forum: https://lbbs.ecuil.com/#/category/10");
|
||||
// Console.WriteLine("");
|
||||
|
||||
// 感觉排版有点割裂,先注释掉
|
||||
// Console.BackgroundColor = ConsoleColor.Red;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Yellow;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Green;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Cyan;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Blue;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Magenta;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.White;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkBlue;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkCyan;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkGreen;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkYellow;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkRed;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Gray;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkGray;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkMagenta;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Black;
|
||||
// Console.Write(" ");
|
||||
// Console.WriteLine("");
|
||||
// Console.ResetColor();
|
||||
Console.WriteLine("------------------------------------------------------");
|
||||
}
|
||||
|
||||
private string FormatBytes(long bytes)
|
||||
{
|
||||
string[] units = { "B", "KB", "MB", "GB", "TB" };
|
||||
@@ -469,10 +545,7 @@ namespace CMLeonOS
|
||||
|
||||
protected override void Run()
|
||||
{
|
||||
if (shell != null)
|
||||
{
|
||||
shell.Run();
|
||||
}
|
||||
ProcessManager.Yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
LISENCE-Cosmos.txt
Normal file
27
LISENCE-Cosmos.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2007-2026, CosmosOS, COSMOS Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,2 +1,2 @@
|
||||
# CMLeanOS 源代码仓库
|
||||
# CMLeonOS 源代码仓库
|
||||
需要 .NET 6.0 或更高版本,Cosmos版本为最新的修改版DevKit。
|
||||
@@ -11,7 +11,8 @@ namespace CMLeonOS.Settings
|
||||
|
||||
private static Dictionary<string, string> defaultSettings = new Dictionary<string, string>
|
||||
{
|
||||
{ "LoggerEnabled", "true" }
|
||||
{ "LoggerEnabled", "true" },
|
||||
{ "MaxLoginAttempts", "3" }
|
||||
};
|
||||
|
||||
public static bool LoggerEnabled
|
||||
@@ -31,6 +32,26 @@ namespace CMLeonOS.Settings
|
||||
}
|
||||
}
|
||||
|
||||
public static int MaxLoginAttempts
|
||||
{
|
||||
get
|
||||
{
|
||||
if (settings.TryGetValue("MaxLoginAttempts", out string value))
|
||||
{
|
||||
if (int.TryParse(value, out int result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
set
|
||||
{
|
||||
settings["MaxLoginAttempts"] = value.ToString();
|
||||
SaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadSettings()
|
||||
{
|
||||
settings.Clear();
|
||||
|
||||
@@ -14,6 +14,19 @@ namespace CMLeonOS
|
||||
currentDirectory = @"0:\";
|
||||
}
|
||||
|
||||
private static bool ContainsInvalidChars(string input)
|
||||
{
|
||||
char[] invalidChars = { '<', '>', '"', '|', '?', '*' };
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (input.Contains(c.ToString()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public FileSystem(string initialPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(initialPath))
|
||||
@@ -46,6 +59,18 @@ namespace CMLeonOS
|
||||
return;
|
||||
}
|
||||
|
||||
if (path == @"0:\")
|
||||
{
|
||||
currentDirectory = @"0:\";
|
||||
return;
|
||||
}
|
||||
|
||||
if (path == @"1:\")
|
||||
{
|
||||
currentDirectory = @"1:\";
|
||||
return;
|
||||
}
|
||||
|
||||
string fullPath = GetFullPath(path);
|
||||
|
||||
try
|
||||
@@ -67,6 +92,12 @@ namespace CMLeonOS
|
||||
|
||||
public void MakeDirectory(string path)
|
||||
{
|
||||
if (ContainsInvalidChars(path))
|
||||
{
|
||||
Console.WriteLine("Error: Directory name contains invalid characters: < > : \" | ?");
|
||||
return;
|
||||
}
|
||||
|
||||
string fullPath = GetFullPath(path);
|
||||
|
||||
try
|
||||
@@ -95,50 +126,51 @@ namespace CMLeonOS
|
||||
{
|
||||
if (Directory.Exists(fullPath))
|
||||
{
|
||||
// 列出当前目录下的文件和子目录
|
||||
string displayPath = path == "." ? CurrentDirectory : path;
|
||||
Console.WriteLine($"Contents of {displayPath}:");
|
||||
|
||||
// 列出子目录
|
||||
try
|
||||
{
|
||||
var dirs = Directory.GetDirectories(fullPath);
|
||||
foreach (var dir in dirs)
|
||||
{
|
||||
// 使用Path.GetFileName获取目录名,避免Substring可能导致的问题
|
||||
string dirName = Path.GetFileName(dir);
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.WriteLine($"[DIR] {dirName}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 可能没有权限或其他错误
|
||||
}
|
||||
|
||||
// 列出文件
|
||||
try
|
||||
{
|
||||
var files = Directory.GetFiles(fullPath);
|
||||
foreach (var file in files)
|
||||
{
|
||||
// 使用Path.GetFileName获取文件名,避免Substring可能导致的问题
|
||||
string fileName = Path.GetFileName(file);
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.WriteLine($"[FILE] {fileName}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 可能没有权限或其他错误
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"Directory not found: {path}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"Error listing files: {ex.Message}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +320,11 @@ namespace CMLeonOS
|
||||
{
|
||||
if (File.Exists(fullPath))
|
||||
{
|
||||
return File.ReadAllText(fullPath);
|
||||
using (FileStream fs = new FileStream(fullPath, FileMode.Open, FileAccess.Read))
|
||||
using (StreamReader sr = new StreamReader(fs))
|
||||
{
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -358,26 +394,60 @@ namespace CMLeonOS
|
||||
|
||||
public string GetFullPath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
if (path.Length > 255)
|
||||
{
|
||||
Console.WriteLine("Error: Path too long (maximum 255 characters)");
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
//char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*' };
|
||||
//foreach (char c in invalidChars)
|
||||
//{
|
||||
// if (path.Contains(c.ToString()))
|
||||
// {
|
||||
// Console.WriteLine($"Error: Invalid character in path: '{c}'");
|
||||
// return currentDirectory;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (path.Contains("//") || path.Contains("\\\\"))
|
||||
{
|
||||
Console.WriteLine("Error: Path contains consecutive slashes");
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
if (path.StartsWith(@"0:\"))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
else if (path == ".")
|
||||
|
||||
if (path.StartsWith(@"1:\"))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
if (path == ".")
|
||||
{
|
||||
return currentDirectory;
|
||||
}
|
||||
else if (path == "..")
|
||||
|
||||
if (path == "..")
|
||||
{
|
||||
if (currentDirectory == @"0:\")
|
||||
if (currentDirectory == @"0:\" || currentDirectory == @"1:\")
|
||||
{
|
||||
return @"0:\";
|
||||
return currentDirectory;
|
||||
}
|
||||
else
|
||||
{
|
||||
int lastSlash = currentDirectory.LastIndexOf('\\');
|
||||
if (lastSlash == 2) // 0:\
|
||||
if (lastSlash == 2) // 0:\ or 1:\
|
||||
{
|
||||
return @"0:\";
|
||||
return currentDirectory.Substring(0, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -385,9 +455,15 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (path.StartsWith("../") || path.StartsWith("..\\"))
|
||||
|
||||
if (path.StartsWith("../") || path.StartsWith("..\\"))
|
||||
{
|
||||
// 支持多层..操作
|
||||
if (currentDirectory == @"0:\" || currentDirectory == @"1:\")
|
||||
{
|
||||
Console.WriteLine("Error: Cannot go above root directory");
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
int level = 0;
|
||||
string tempPath = path;
|
||||
while (tempPath.StartsWith("../") || tempPath.StartsWith("..\\"))
|
||||
@@ -401,16 +477,21 @@ namespace CMLeonOS
|
||||
{
|
||||
tempPath = tempPath.Substring(3);
|
||||
}
|
||||
|
||||
if (level > 10)
|
||||
{
|
||||
Console.WriteLine("Error: Too many parent directory references");
|
||||
return currentDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
// 向上移动level级
|
||||
string resultPath = currentDirectory;
|
||||
for (int i = 0; i < level; i++)
|
||||
{
|
||||
int lastSlash = resultPath.LastIndexOf('\\');
|
||||
if (lastSlash == 2) // 0:\
|
||||
if (lastSlash == 2) // 0:\ or 1:\
|
||||
{
|
||||
resultPath = @"0:\";
|
||||
resultPath = resultPath.Substring(0, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -419,12 +500,11 @@ namespace CMLeonOS
|
||||
}
|
||||
return resultPath;
|
||||
}
|
||||
else if (path.StartsWith("dir") || path.StartsWith("DIR"))
|
||||
|
||||
if (path.StartsWith("dir") || path.StartsWith("DIR"))
|
||||
{
|
||||
// 支持cd dir1/dir2/dir3等格式
|
||||
string dirName = path;
|
||||
|
||||
// 提取数字部分
|
||||
string numberPart = "";
|
||||
for (int i = 3; i < path.Length; i++)
|
||||
{
|
||||
@@ -438,7 +518,6 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
|
||||
// 构建完整路径
|
||||
if (currentDirectory == @"0:\")
|
||||
{
|
||||
return $@"0:\{dirName}";
|
||||
@@ -448,16 +527,46 @@ namespace CMLeonOS
|
||||
return $@"{currentDirectory}\{dirName}";
|
||||
}
|
||||
}
|
||||
|
||||
string normalizedPath = path;
|
||||
|
||||
while (normalizedPath.Contains("//"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Replace("//", "/");
|
||||
}
|
||||
|
||||
while (normalizedPath.Contains("\\\\"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Replace("\\\\", "\\");
|
||||
}
|
||||
|
||||
if (normalizedPath.StartsWith("/"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(1);
|
||||
}
|
||||
|
||||
if (normalizedPath.StartsWith("\\"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(1);
|
||||
}
|
||||
|
||||
if (normalizedPath.EndsWith("/"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(0, normalizedPath.Length - 1);
|
||||
}
|
||||
|
||||
if (normalizedPath.EndsWith("\\"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(0, normalizedPath.Length - 1);
|
||||
}
|
||||
|
||||
if (currentDirectory == @"0:\")
|
||||
{
|
||||
return $@"0:\{normalizedPath}";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentDirectory == @"0:\")
|
||||
{
|
||||
return $@"0:\{path}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $@"{currentDirectory}\{path}";
|
||||
}
|
||||
return $@"{currentDirectory}\{normalizedPath}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
184
System/Process.cs
Normal file
184
System/Process.cs
Normal file
@@ -0,0 +1,184 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Sys = Cosmos.System;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public enum ProcessType
|
||||
{
|
||||
Service,
|
||||
Application,
|
||||
Background
|
||||
}
|
||||
|
||||
public abstract class Process
|
||||
{
|
||||
private protected Process(string name, ProcessType type)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
private protected Process(string name, ProcessType type, Process parent)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
Parent = parent;
|
||||
}
|
||||
|
||||
internal ulong Id { get; set; }
|
||||
|
||||
internal List<string> Args { get; private set; }
|
||||
|
||||
internal string Name { get; set; }
|
||||
|
||||
internal ProcessType Type { get; private set; }
|
||||
|
||||
internal DateTime Created { get; private set; } = DateTime.Now;
|
||||
|
||||
internal bool IsRunning { get; private set; } = false;
|
||||
|
||||
internal bool Swept { get; set; } = false;
|
||||
|
||||
internal bool Critical { get; set; } = false;
|
||||
|
||||
internal Process Parent { get; set; }
|
||||
|
||||
public virtual void Start()
|
||||
{
|
||||
if (Type == ProcessType.Service)
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Info("Process", $"Service starting: {Name}");
|
||||
}
|
||||
|
||||
IsRunning = true;
|
||||
}
|
||||
|
||||
public abstract void Run();
|
||||
|
||||
public virtual void Stop()
|
||||
{
|
||||
if (Type == ProcessType.Service)
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Info("Process", $"Service stopping: {Name}");
|
||||
}
|
||||
|
||||
IsRunning = false;
|
||||
foreach (Process process in ProcessManager.Processes)
|
||||
{
|
||||
if (process.Parent == this && process.IsRunning)
|
||||
{
|
||||
process.TryStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TryRun()
|
||||
{
|
||||
try
|
||||
{
|
||||
Run();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (Critical)
|
||||
{
|
||||
Console.Clear();
|
||||
Console.BackgroundColor = ConsoleColor.Blue;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine(" CRITICAL PROCESS CRASHED");
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Process: {Name}");
|
||||
Console.WriteLine($"ID: {Id}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Error:");
|
||||
Console.WriteLine(e.ToString());
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press any key to reboot...");
|
||||
Console.ReadKey();
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Error("Process", $"Process \"{Name}\" ({Id}) crashed: {e.ToString()}");
|
||||
TryStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TryStart()
|
||||
{
|
||||
try
|
||||
{
|
||||
Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (Critical)
|
||||
{
|
||||
Console.Clear();
|
||||
Console.BackgroundColor = ConsoleColor.Blue;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine(" CRITICAL PROCESS CRASHED");
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Process: {Name}");
|
||||
Console.WriteLine($"ID: {Id}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Error:");
|
||||
Console.WriteLine(e.ToString());
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press any key to reboot...");
|
||||
Console.ReadKey();
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Error("Process", $"Process \"{Name}\" ({Id}) crashed while starting: {e.ToString()}");
|
||||
TryStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TryStop()
|
||||
{
|
||||
try
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
IsRunning = false;
|
||||
if (Critical)
|
||||
{
|
||||
Console.Clear();
|
||||
Console.BackgroundColor = ConsoleColor.Blue;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine(" CRITICAL PROCESS CRASHED");
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Process: {Name}");
|
||||
Console.WriteLine($"ID: {Id}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Error:");
|
||||
Console.WriteLine(e.ToString());
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press any key to reboot...");
|
||||
Console.ReadKey();
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Error("Process", $"Process \"{Name}\" ({Id}) crashed while stopping: {e.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
System/ProcessManager.cs
Normal file
92
System/ProcessManager.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public static class ProcessManager
|
||||
{
|
||||
public static List<Process> Processes = new List<Process>();
|
||||
|
||||
private static ulong nextProcessId = 0;
|
||||
|
||||
|
||||
public static Process AddProcess(Process parent, Process process)
|
||||
{
|
||||
process.Parent = parent;
|
||||
AddProcess(process);
|
||||
return process;
|
||||
}
|
||||
|
||||
public static Process AddProcess(Process process)
|
||||
{
|
||||
|
||||
if (Processes.Contains(process))
|
||||
return process;
|
||||
|
||||
process.Id = nextProcessId;
|
||||
nextProcessId++;
|
||||
|
||||
Processes.Add(process);
|
||||
|
||||
return process;
|
||||
}
|
||||
|
||||
public static void Sweep()
|
||||
{
|
||||
for (int i = Processes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (!Processes[i].IsRunning)
|
||||
{
|
||||
Processes.Remove(Processes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Yield()
|
||||
{
|
||||
for (int i = Processes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Process process = Processes[i];
|
||||
if (process.IsRunning)
|
||||
{
|
||||
process.TryRun();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Process GetProcessById(ulong processId)
|
||||
{
|
||||
foreach (Process process in Processes)
|
||||
{
|
||||
if (process.Id == processId) return process;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Process GetProcessByName(string name)
|
||||
{
|
||||
foreach (Process process in Processes)
|
||||
{
|
||||
if (process.Name == name) return process;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static T GetProcess<T>()
|
||||
{
|
||||
foreach (Process process in Processes)
|
||||
{
|
||||
if (process is T processT) return processT;
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public static void StopAll()
|
||||
{
|
||||
for (int i = Processes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Process process = Processes[i];
|
||||
process.TryStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
System/ShellProcess.cs
Normal file
63
System/ShellProcess.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CMLeonOS.Commands;
|
||||
using CMLeonOS.shell;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public class ShellProcess : Process
|
||||
{
|
||||
private Shell shell;
|
||||
|
||||
public ShellProcess(UserSystem userSystem) : base("Shell", ProcessType.Application)
|
||||
{
|
||||
shell = new Shell(userSystem);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Info("Shell", "Shell process started");
|
||||
|
||||
try
|
||||
{
|
||||
shell.Run();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Error("Shell", $"Shell crashed: {e.ToString()}");
|
||||
}
|
||||
|
||||
CMLeonOS.Logger.Logger.Instance.Info("Shell", "Shell process stopped");
|
||||
}
|
||||
}
|
||||
|
||||
public class CommandProcess : Process
|
||||
{
|
||||
private string command;
|
||||
private string args;
|
||||
private Shell shell;
|
||||
|
||||
public CommandProcess(string command, string args, Shell shell) : base($"Command_{command}", ProcessType.Application)
|
||||
{
|
||||
this.command = command;
|
||||
this.args = args;
|
||||
this.shell = shell;
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Info($"Command_{command}", $"Executing command: {command} {args}");
|
||||
|
||||
try
|
||||
{
|
||||
CommandList.ProcessCommand(shell, command, args);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CMLeonOS.Logger.Logger.Instance.Error($"Command_{command}", $"Command failed: {e.ToString()}");
|
||||
}
|
||||
|
||||
CMLeonOS.Logger.Logger.Instance.Info($"Command_{command}", $"Command completed: {command}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Sys = Cosmos.System;
|
||||
using CMLeonOS.Logger;
|
||||
using CMLeonOS.Settings;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
@@ -23,6 +25,8 @@ namespace CMLeonOS
|
||||
private List<User> users;
|
||||
public bool fixmode = Kernel.FixMode;
|
||||
private User currentLoggedInUser;
|
||||
private static CMLeonOS.Logger.Logger _logger = CMLeonOS.Logger.Logger.Instance;
|
||||
private Dictionary<string, int> loginAttempts = new Dictionary<string, int>();
|
||||
|
||||
public User CurrentLoggedInUser
|
||||
{
|
||||
@@ -53,6 +57,19 @@ namespace CMLeonOS
|
||||
return Convert.ToBase64String(sha256.GetHash());
|
||||
}
|
||||
|
||||
private static bool ContainsInvalidChars(string input)
|
||||
{
|
||||
char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*', '/', '\\', ' ' };
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (input.Contains(c.ToString()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public UserSystem()
|
||||
{
|
||||
EnsureSysDirectoryExists();
|
||||
@@ -388,6 +405,17 @@ namespace CMLeonOS
|
||||
username = global::System.Console.ReadLine();
|
||||
}
|
||||
|
||||
while (ContainsInvalidChars(username))
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Username contains invalid characters: < > : \" | ? * / \\ space");
|
||||
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: ");
|
||||
@@ -495,7 +523,7 @@ namespace CMLeonOS
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"Creating user folder for {username}...");
|
||||
_logger.Info("UserSystem", $"Creating user folder for {username}...");
|
||||
|
||||
// 在user文件夹下创建用户文件夹
|
||||
string userFolderPath = Path.Combine(@"0:\user", username);
|
||||
@@ -504,16 +532,16 @@ namespace CMLeonOS
|
||||
if (!Directory.Exists(userFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(userFolderPath);
|
||||
Console.WriteLine($"Created user folder for {username}.");
|
||||
_logger.Info("UserSystem", $"Created user folder for {username}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"User folder for {username} already exists.");
|
||||
_logger.Info("UserSystem", $"User folder for {username} already exists.");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error creating user folder: {ex.Message}");
|
||||
_logger.Error("UserSystem", $"Error creating user folder for {username}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,13 +595,37 @@ namespace CMLeonOS
|
||||
|
||||
if (foundUser.Password != hashedInputPassword)
|
||||
{
|
||||
string usernameLower = username.ToLower();
|
||||
|
||||
if (!loginAttempts.ContainsKey(usernameLower))
|
||||
{
|
||||
loginAttempts[usernameLower] = 0;
|
||||
}
|
||||
|
||||
loginAttempts[usernameLower]++;
|
||||
int attempts = loginAttempts[usernameLower];
|
||||
int maxAttempts = Settings.SettingsManager.MaxLoginAttempts;
|
||||
|
||||
if (attempts >= maxAttempts)
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 24);
|
||||
global::System.Console.Write($"Maximum login attempts ({maxAttempts}) reached. ");
|
||||
global::System.Console.SetCursorPosition(17, 25);
|
||||
global::System.Console.Write("Please restart to enter password again. ");
|
||||
global::System.Threading.Thread.Sleep(3000);
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
|
||||
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.Console.Write($"Invalid password. Attempts: {attempts}/{maxAttempts} ");
|
||||
global::System.Threading.Thread.Sleep(1000);
|
||||
return false;
|
||||
}
|
||||
|
||||
loginAttempts.Remove(username.ToLower());
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 24);
|
||||
global::System.Console.Write("Login successful! ");
|
||||
|
||||
@@ -329,6 +329,60 @@ nano <file>
|
||||
nano myfile.txt
|
||||
```
|
||||
|
||||
### hex
|
||||
使用16进制编辑器编辑二进制文件。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
hex <filename>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
hex test.bin
|
||||
hex kernel.sys
|
||||
```
|
||||
|
||||
**控制键:**
|
||||
- `↑ ↓ ← →` - 移动光标
|
||||
- `Page Up / Page Down` - 滚动视图
|
||||
- `0-9, A-F` - 编辑字节值
|
||||
- `S` - 保存文件
|
||||
- `Q` - 退出编辑器
|
||||
|
||||
**说明:**
|
||||
- 显示文件的16进制字节值和对应的ASCII字符
|
||||
- 每行显示16个字节,分为8个字节一组
|
||||
- 显示每行的偏移地址(8位16进制)
|
||||
- 光标位置用白色背景高亮显示
|
||||
- 文件修改后显示 [MODIFIED] 标记
|
||||
- 支持查看和编辑任意大小的二进制文件
|
||||
- 按 S 键保存修改到文件
|
||||
- 按 Q 键退出编辑器(不保存修改)
|
||||
|
||||
**界面示例:**
|
||||
```
|
||||
====================================
|
||||
Hex Editor
|
||||
====================================
|
||||
|
||||
File: test.bin
|
||||
Size: 256 bytes [MODIFIED]
|
||||
|
||||
00000000 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 00 00 |Hello World.....|
|
||||
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
||||
|
||||
Cursor: 0x00000000 (0)
|
||||
Value: 0x48
|
||||
|
||||
Controls:
|
||||
Arrow Keys - Move cursor
|
||||
Page Up/Down - Scroll view
|
||||
0-9, A-F - Edit byte
|
||||
S - Save file
|
||||
Q - Quit
|
||||
```
|
||||
|
||||
## 用户管理命令
|
||||
|
||||
### user
|
||||
@@ -498,6 +552,41 @@ lua <file>
|
||||
lua script.lua
|
||||
```
|
||||
|
||||
### lua2cla
|
||||
将 Lua 文件转换为 CMLeonOS Lua 应用格式(.cla)。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
lua2cla <lua_file>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
lua2cla app.lua
|
||||
```
|
||||
|
||||
**说明:**
|
||||
- 文件头为 `CMLeonOS_CLA`
|
||||
- 转换后的文件可以通过 `cla` 命令运行
|
||||
|
||||
### cla
|
||||
运行 CMLeonOS Lua 应用格式(.cla)文件。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
cla <cla_file>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
cla app.cla
|
||||
```
|
||||
|
||||
**说明:**
|
||||
- 运行 .cla 格式的加密 Lua 应用
|
||||
- 自动解密并执行 Lua 代码
|
||||
- 文件头必须为 `CMLeonOS_CLA`
|
||||
|
||||
### com
|
||||
执行命令脚本文件。
|
||||
|
||||
@@ -636,7 +725,7 @@ app list # 列出所有可用应用
|
||||
app install <name> # 安装应用
|
||||
app uninstall <name> # 卸载应用
|
||||
app installed # 列出已安装应用
|
||||
app help # 显示帮助信息
|
||||
app help # 显示帮助信息
|
||||
```
|
||||
|
||||
**示例:**
|
||||
@@ -691,6 +780,18 @@ unalias ll
|
||||
version
|
||||
```
|
||||
|
||||
**输出:**
|
||||
```
|
||||
CMLeonOS v1.0.0 (PreRelease 2) - Git: b80c5b4
|
||||
Major: 1
|
||||
Minor: 0
|
||||
Patch: 0
|
||||
Type: PreRelease 2
|
||||
Full Version: 1.0.0-PreRelease 2
|
||||
Git Commit: b80c5b4
|
||||
Build Time: 2026-02-12 15:30:45
|
||||
```
|
||||
|
||||
### settings
|
||||
查看或修改系统设置。
|
||||
|
||||
@@ -755,34 +856,6 @@ restart
|
||||
shutdown
|
||||
```
|
||||
|
||||
## 备份与恢复命令
|
||||
|
||||
### backup
|
||||
备份系统。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
backup <backup_file>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
backup mybackup.zip
|
||||
```
|
||||
|
||||
### restore
|
||||
恢复系统备份。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
restore <backup_file>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
restore mybackup.zip
|
||||
```
|
||||
|
||||
## 测试命令
|
||||
|
||||
### cuitest
|
||||
@@ -793,6 +866,14 @@ restore mybackup.zip
|
||||
cuitest
|
||||
```
|
||||
|
||||
### testtui
|
||||
测试 TUI 框架。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
testtui
|
||||
```
|
||||
|
||||
### testgui
|
||||
测试图形界面。
|
||||
|
||||
@@ -828,8 +909,8 @@ snake
|
||||
**说明:**
|
||||
- 使用方向键 (↑ ↓ ← →) 控制蛇的移动
|
||||
- 按 ESC 或 Q 键退出游戏
|
||||
- 蛇身用绿色 ■ 表示
|
||||
- 食物用红色 ● 表示
|
||||
- 蛇身用绿色 # 表示
|
||||
- 食物用红色 O 表示
|
||||
- 吃到食物得分 +10 分
|
||||
- 撞到墙壁或自己身体游戏结束
|
||||
- 游戏区域:40x20 字符
|
||||
|
||||
707
editor/Nano.cs
707
editor/Nano.cs
@@ -1,9 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UniLua;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public class NanoSettings
|
||||
{
|
||||
public bool EnableSmartIndent { get; set; } = true;
|
||||
public bool EnableAutoCompleteBrackets { get; set; } = true;
|
||||
public bool EnableAutoCompleteQuotes { get; set; } = true;
|
||||
public bool EnableSmartDelete { get; set; } = true;
|
||||
public bool EnableSyntaxHighlight { get; set; } = true;
|
||||
|
||||
public void Save(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool smartIndent = EnableSmartIndent;
|
||||
bool autoBrackets = EnableAutoCompleteBrackets;
|
||||
bool autoQuotes = EnableAutoCompleteQuotes;
|
||||
bool smartDelete = EnableSmartDelete;
|
||||
bool syntaxHighlight = EnableSyntaxHighlight;
|
||||
|
||||
string content = $"{smartIndent},{autoBrackets},{autoQuotes},{smartDelete},{syntaxHighlight}";
|
||||
using (StreamWriter sw = new StreamWriter(filePath))
|
||||
{
|
||||
sw.Write(content);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Load(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(filePath))
|
||||
{
|
||||
string content = sr.ReadToEnd();
|
||||
string[] parts = content.Split(',');
|
||||
if (parts.Length >= 5)
|
||||
{
|
||||
bool smartIndent, autoBrackets, autoQuotes, smartDelete, syntaxHighlight;
|
||||
bool.TryParse(parts[0], out smartIndent);
|
||||
bool.TryParse(parts[1], out autoBrackets);
|
||||
bool.TryParse(parts[2], out autoQuotes);
|
||||
bool.TryParse(parts[3], out smartDelete);
|
||||
bool.TryParse(parts[4], out syntaxHighlight);
|
||||
|
||||
EnableSmartIndent = smartIndent;
|
||||
EnableAutoCompleteBrackets = autoBrackets;
|
||||
EnableAutoCompleteQuotes = autoQuotes;
|
||||
EnableSmartDelete = smartDelete;
|
||||
EnableSyntaxHighlight = syntaxHighlight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Nano
|
||||
{
|
||||
private string path;
|
||||
@@ -22,6 +86,7 @@ namespace CMLeonOS
|
||||
private FileSystem fileSystem;
|
||||
private UserSystem userSystem;
|
||||
private Shell shell;
|
||||
private NanoSettings settings = new NanoSettings();
|
||||
|
||||
private readonly (string, string)[] SHORTCUTS = new (string, string)[]
|
||||
{
|
||||
@@ -47,15 +112,22 @@ namespace CMLeonOS
|
||||
|
||||
if (value != null && fileSystem != null)
|
||||
{
|
||||
string fullPath = fileSystem.GetFullPath(value);
|
||||
|
||||
if (System.IO.File.Exists(fullPath))
|
||||
try
|
||||
{
|
||||
string fullPath = fileSystem.GetFullPath(value);
|
||||
string text = fileSystem.ReadFile(fullPath);
|
||||
text = text.Replace("\r\n", "\n");
|
||||
lines.AddRange(text.Split('\n'));
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
text = text.Replace("\r\n", "\n");
|
||||
lines.AddRange(text.Split('\n'));
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch
|
||||
{
|
||||
lines.Add(string.Empty);
|
||||
}
|
||||
@@ -90,7 +162,6 @@ namespace CMLeonOS
|
||||
{
|
||||
int y = i - scrollY + TITLEBAR_HEIGHT;
|
||||
if (y < TITLEBAR_HEIGHT || y >= consoleHeight - SHORTCUT_BAR_HEIGHT) continue;
|
||||
|
||||
Console.SetCursorPosition(0, y);
|
||||
|
||||
if (i >= lines.Count || scrollX >= lines[i].Length)
|
||||
@@ -100,7 +171,15 @@ namespace CMLeonOS
|
||||
else
|
||||
{
|
||||
string line = lines[i].Substring(scrollX, Math.Min(consoleWidth, lines[i].Length - scrollX));
|
||||
Console.Write(line + new string(' ', Math.Max(0, consoleWidth - line.Length)));
|
||||
|
||||
if (IsLuaFile() && settings.EnableSyntaxHighlight)
|
||||
{
|
||||
RenderLuaLine(line, consoleWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line + new string(' ', Math.Max(0, consoleWidth - line.Length)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,34 +190,410 @@ namespace CMLeonOS
|
||||
Console.SetCursorPosition(linePos - scrollX, currentLine + TITLEBAR_HEIGHT - scrollY);
|
||||
}
|
||||
|
||||
private bool IsLuaFile()
|
||||
{
|
||||
if (path != null)
|
||||
{
|
||||
string extension = System.IO.Path.GetExtension(path)?.ToLower();
|
||||
return extension == ".lua";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void RenderLuaLine(string line, int consoleWidth)
|
||||
{
|
||||
int pos = 0;
|
||||
bool inString = false;
|
||||
bool inComment = false;
|
||||
bool inLongComment = false;
|
||||
char stringDelimiter = '\0';
|
||||
|
||||
while (pos < line.Length && pos < consoleWidth)
|
||||
{
|
||||
if (inComment)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else if (inLongComment)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
if (pos + 1 < line.Length && line[pos] == ']' && line[pos + 1] == ']')
|
||||
{
|
||||
inLongComment = false;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (pos + 1 < line.Length && line[pos] == '-' && line[pos + 1] == '-')
|
||||
{
|
||||
if (pos + 3 < line.Length && line[pos + 2] == '[' && line[pos + 3] == '[')
|
||||
{
|
||||
inLongComment = true;
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write(line.Substring(pos));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
inComment = true;
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write(line.Substring(pos));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (inString)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
if (line[pos] == stringDelimiter)
|
||||
{
|
||||
if (pos + 1 < line.Length && line[pos + 1] == stringDelimiter)
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
inString = false;
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (line[pos] == '\\')
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
if (pos < line.Length)
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (line[pos] == '"' || line[pos] == '\'')
|
||||
{
|
||||
inString = true;
|
||||
stringDelimiter = line[pos];
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else if (IsLuaNumber(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Magenta;
|
||||
while (pos < line.Length && IsLuaNumber(line, pos))
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (IsLuaOperator(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||
if (pos + 1 < line.Length && IsLuaOperator(line, pos + 1))
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (IsLuaKeyword(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
string keyword = GetLuaKeyword(line, pos);
|
||||
Console.Write(keyword);
|
||||
pos += keyword.Length;
|
||||
}
|
||||
else if (IsLuaBuiltin(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkCyan;
|
||||
string builtin = GetLuaBuiltin(line, pos);
|
||||
Console.Write(builtin);
|
||||
pos += builtin.Length;
|
||||
}
|
||||
else if (IsLuaFunctionCall(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkMagenta;
|
||||
string funcName = GetLuaFunctionName(line, pos);
|
||||
Console.Write(funcName);
|
||||
pos += funcName.Length;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pos < consoleWidth)
|
||||
{
|
||||
Console.Write(new string(' ', consoleWidth - pos));
|
||||
}
|
||||
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
private bool IsLuaNumber(string line, int pos)
|
||||
{
|
||||
if (pos >= line.Length) return false;
|
||||
|
||||
char c = line[pos];
|
||||
if (!char.IsDigit(c) && c != '.') return false;
|
||||
|
||||
if (c == '.')
|
||||
{
|
||||
if (pos + 1 >= line.Length) return false;
|
||||
return char.IsDigit(line[pos + 1]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsLuaOperator(string line, int pos)
|
||||
{
|
||||
if (pos >= line.Length) return false;
|
||||
|
||||
char c = line[pos];
|
||||
return c == '+' || c == '-' || c == '*' || c == '/' || c == '^' ||
|
||||
c == '%' || c == '#' || c == '=' || c == '~' ||
|
||||
c == '<' || c == '>' || c == '&' || c == '|' ||
|
||||
c == '(' || c == ')' || c == '[' || c == ']' ||
|
||||
c == '{' || c == '}' || c == ',' || c == ';';
|
||||
}
|
||||
|
||||
private bool IsLuaKeyword(string line, int pos)
|
||||
{
|
||||
string[] keywords = {
|
||||
"function", "end", "if", "then", "else", "elseif", "while", "do",
|
||||
"for", "return", "local", "true", "false", "nil", "and", "or",
|
||||
"not", "break", "repeat", "until", "in", "goto", "self"
|
||||
};
|
||||
|
||||
foreach (string keyword in keywords)
|
||||
{
|
||||
if (pos + keyword.Length <= line.Length && line.Substring(pos, keyword.Length) == keyword)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + keyword.Length < line.Length ? line[pos + keyword.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetLuaKeyword(string line, int pos)
|
||||
{
|
||||
string[] keywords = {
|
||||
"function", "end", "if", "then", "else", "elseif", "while", "do",
|
||||
"for", "return", "local", "true", "false", "nil", "and", "or",
|
||||
"not", "break", "repeat", "until", "in", "goto", "self"
|
||||
};
|
||||
|
||||
foreach (string keyword in keywords)
|
||||
{
|
||||
if (pos + keyword.Length <= line.Length && line.Substring(pos, keyword.Length) == keyword)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + keyword.Length < line.Length ? line[pos + keyword.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return keyword;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private bool IsLuaBuiltin(string line, int pos)
|
||||
{
|
||||
string[] builtins = {
|
||||
"print", "type", "tonumber", "tostring", "pairs", "ipairs",
|
||||
"next", "select", "unpack", "assert", "error", "pcall",
|
||||
"xpcall", "load", "loadstring", "loadfile", "dofile",
|
||||
"require", "setmetatable", "getmetatable", "rawget", "rawset",
|
||||
"rawequal", "rawlen", "gcinfo", "collectgarbage", "newproxy"
|
||||
};
|
||||
|
||||
foreach (string builtin in builtins)
|
||||
{
|
||||
if (pos + builtin.Length <= line.Length && line.Substring(pos, builtin.Length) == builtin)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + builtin.Length < line.Length ? line[pos + builtin.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetLuaBuiltin(string line, int pos)
|
||||
{
|
||||
string[] builtins = {
|
||||
"print", "type", "tonumber", "tostring", "pairs", "ipairs",
|
||||
"next", "select", "unpack", "assert", "error", "pcall",
|
||||
"xpcall", "load", "loadstring", "loadfile", "dofile",
|
||||
"require", "setmetatable", "getmetatable", "rawget", "rawset",
|
||||
"rawequal", "rawlen", "gcinfo", "collectgarbage", "newproxy"
|
||||
};
|
||||
|
||||
foreach (string builtin in builtins)
|
||||
{
|
||||
if (pos + builtin.Length <= line.Length && line.Substring(pos, builtin.Length) == builtin)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + builtin.Length < line.Length ? line[pos + builtin.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return builtin;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private bool IsLuaFunctionCall(string line, int pos)
|
||||
{
|
||||
if (pos >= line.Length || !char.IsLetter(line[pos]) && line[pos] != '_') return false;
|
||||
|
||||
int endPos = pos;
|
||||
while (endPos < line.Length && (char.IsLetterOrDigit(line[endPos]) || line[endPos] == '_'))
|
||||
{
|
||||
endPos++;
|
||||
}
|
||||
|
||||
if (endPos < line.Length && line[endPos] == '(')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetLuaFunctionName(string line, int pos)
|
||||
{
|
||||
int endPos = pos;
|
||||
while (endPos < line.Length && (char.IsLetterOrDigit(line[endPos]) || line[endPos] == '_'))
|
||||
{
|
||||
endPos++;
|
||||
}
|
||||
return line.Substring(pos, endPos - pos);
|
||||
}
|
||||
|
||||
// Insert a new line at the cursor.
|
||||
private void InsertLine()
|
||||
{
|
||||
string line = lines[currentLine];
|
||||
if (linePos == line.Length)
|
||||
|
||||
if (IsLuaFile() && settings.EnableSmartIndent)
|
||||
{
|
||||
lines.Insert(currentLine + 1, string.Empty);
|
||||
string currentIndent = GetLineIndent(line);
|
||||
|
||||
if (linePos == line.Length)
|
||||
{
|
||||
lines.Insert(currentLine + 1, currentIndent);
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Insert(currentLine + 1, currentIndent + line.Substring(linePos, line.Length - linePos));
|
||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||
}
|
||||
|
||||
if (line.TrimEnd().EndsWith("then") || line.TrimEnd().EndsWith("do") || line.TrimEnd().EndsWith("else") || line.TrimEnd().EndsWith("elseif") || line.TrimEnd().EndsWith("repeat"))
|
||||
{
|
||||
lines[currentLine + 1] = lines[currentLine + 1] + " ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Insert(currentLine + 1, line.Substring(linePos, line.Length - linePos));
|
||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||
if (linePos == line.Length)
|
||||
{
|
||||
lines.Insert(currentLine + 1, string.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Insert(currentLine + 1, line.Substring(linePos, line.Length - linePos));
|
||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||
}
|
||||
}
|
||||
|
||||
updatedLinesStart = currentLine;
|
||||
updatedLinesEnd = lines.Count - 1;
|
||||
|
||||
currentLine += 1;
|
||||
linePos = 0;
|
||||
linePos = lines[currentLine].Length;
|
||||
|
||||
modified = true;
|
||||
}
|
||||
|
||||
private string GetLineIndent(string line)
|
||||
{
|
||||
int indent = 0;
|
||||
foreach (char c in line)
|
||||
{
|
||||
if (c == ' ')
|
||||
{
|
||||
indent++;
|
||||
}
|
||||
else if (c == '\t')
|
||||
{
|
||||
indent += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new string(' ', indent);
|
||||
}
|
||||
|
||||
// Insert text at the cursor.
|
||||
private void Insert(string text)
|
||||
{
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, text[i].ToString());
|
||||
char c = text[i];
|
||||
|
||||
if (IsLuaFile())
|
||||
{
|
||||
c = HandleLuaAutoComplete(c);
|
||||
}
|
||||
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, c.ToString());
|
||||
linePos++;
|
||||
|
||||
updatedLinesStart = currentLine;
|
||||
@@ -147,6 +602,54 @@ namespace CMLeonOS
|
||||
modified = true;
|
||||
}
|
||||
|
||||
private char HandleLuaAutoComplete(char c)
|
||||
{
|
||||
string line = lines[currentLine];
|
||||
|
||||
if (settings.EnableAutoCompleteBrackets)
|
||||
{
|
||||
if (c == '(')
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, ")");
|
||||
return '(';
|
||||
}
|
||||
else if (c == '[')
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "]");
|
||||
return '[';
|
||||
}
|
||||
else if (c == '{')
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "}");
|
||||
return '{';
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.EnableAutoCompleteQuotes)
|
||||
{
|
||||
if (c == '"')
|
||||
{
|
||||
if (linePos > 0 && line[linePos - 1] == '\\')
|
||||
{
|
||||
return '"';
|
||||
}
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "\"");
|
||||
return '"';
|
||||
}
|
||||
else if (c == '\'')
|
||||
{
|
||||
if (linePos > 0 && line[linePos - 1] == '\\')
|
||||
{
|
||||
return '\'';
|
||||
}
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "'");
|
||||
return '\'';
|
||||
}
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
private void InsertTab()
|
||||
{
|
||||
Insert(" ");
|
||||
@@ -169,6 +672,17 @@ namespace CMLeonOS
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsLuaFile() && settings.EnableSmartDelete)
|
||||
{
|
||||
string line = lines[currentLine];
|
||||
char charToDelete = line[linePos - 1];
|
||||
|
||||
if (linePos < line.Length && IsMatchingPair(charToDelete, line[linePos]))
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Remove(linePos, 1);
|
||||
}
|
||||
}
|
||||
|
||||
lines[currentLine] = lines[currentLine].Remove(linePos - 1, 1);
|
||||
linePos--;
|
||||
|
||||
@@ -178,6 +692,15 @@ namespace CMLeonOS
|
||||
modified = true;
|
||||
}
|
||||
|
||||
private bool IsMatchingPair(char open, char close)
|
||||
{
|
||||
return (open == '(' && close == ')') ||
|
||||
(open == '[' && close == ']') ||
|
||||
(open == '{' && close == '}') ||
|
||||
(open == '"' && close == '"') ||
|
||||
(open == '\'' && close == '\'');
|
||||
}
|
||||
|
||||
// Move the cursor left.
|
||||
private void MoveLeft()
|
||||
{
|
||||
@@ -702,6 +1225,9 @@ namespace CMLeonOS
|
||||
}
|
||||
switch (key.Key)
|
||||
{
|
||||
case ConsoleKey.F2:
|
||||
ShowSettingsMenu();
|
||||
return true;
|
||||
case ConsoleKey.Tab:
|
||||
InsertTab();
|
||||
break;
|
||||
@@ -807,12 +1333,163 @@ namespace CMLeonOS
|
||||
RenderShortcuts(SHORTCUTS);
|
||||
}
|
||||
|
||||
private void ShowSettingsMenu()
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Blue;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
|
||||
int consoleWidth = 80;
|
||||
int consoleHeight = 25;
|
||||
|
||||
string title = " Nano Settings";
|
||||
string[] options = new string[]
|
||||
{
|
||||
"1. Smart Indent",
|
||||
"2. Auto Complete Brackets",
|
||||
"3. Auto Complete Quotes",
|
||||
"4. Smart Delete",
|
||||
"5. Syntax Highlight",
|
||||
"6. Save and Exit"
|
||||
};
|
||||
|
||||
int maxOptionLength = 0;
|
||||
foreach (string option in options)
|
||||
{
|
||||
if (option.Length > maxOptionLength)
|
||||
{
|
||||
maxOptionLength = option.Length;
|
||||
}
|
||||
}
|
||||
|
||||
int menuWidth = maxOptionLength + 10;
|
||||
int menuHeight = options.Length + 4;
|
||||
int menuX = (consoleWidth - menuWidth) / 2;
|
||||
int menuY = (consoleHeight - menuHeight) / 2;
|
||||
|
||||
int titleX = menuX + (menuWidth - title.Length) / 2;
|
||||
Console.SetCursorPosition(titleX, menuY);
|
||||
Console.Write(title);
|
||||
|
||||
int borderLeft = menuX;
|
||||
int borderRight = menuX + menuWidth - 1;
|
||||
int borderTop = menuY;
|
||||
int borderBottom = menuY + menuHeight - 1;
|
||||
|
||||
for (int i = 0; i < menuWidth; i++)
|
||||
{
|
||||
Console.SetCursorPosition(borderLeft + i, borderTop);
|
||||
Console.Write("-");
|
||||
}
|
||||
|
||||
for (int i = 0; i < menuHeight; i++)
|
||||
{
|
||||
Console.SetCursorPosition(borderLeft, borderTop + 1 + i);
|
||||
Console.Write("|");
|
||||
Console.SetCursorPosition(borderRight, borderTop + 1 + i);
|
||||
Console.Write("|");
|
||||
}
|
||||
|
||||
for (int i = 0; i < menuWidth; i++)
|
||||
{
|
||||
Console.SetCursorPosition(borderLeft + i, borderBottom);
|
||||
Console.Write("-");
|
||||
}
|
||||
|
||||
for (int i = 0; i < options.Length; i++)
|
||||
{
|
||||
int optionY = borderTop + 2 + i;
|
||||
Console.SetCursorPosition(borderLeft + 2, optionY);
|
||||
Console.Write(options[i]);
|
||||
|
||||
string status = GetSettingStatus(i);
|
||||
int statusX = borderRight - status.Length - 2;
|
||||
Console.SetCursorPosition(statusX, optionY);
|
||||
Console.Write($"[{status}]");
|
||||
}
|
||||
|
||||
int promptY = borderBottom - 2;
|
||||
string prompt = "Use 1-6 to toggle, ESC to exit";
|
||||
int promptX = menuX + (menuWidth - prompt.Length) / 2;
|
||||
Console.SetCursorPosition(promptX, promptY);
|
||||
Console.Write(prompt);
|
||||
|
||||
while (true)
|
||||
{
|
||||
ConsoleKeyInfo key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (key.KeyChar >= '1' && key.KeyChar <= '6')
|
||||
{
|
||||
int option = key.KeyChar - '1';
|
||||
ToggleSetting(option);
|
||||
ShowSettingsMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
RenderUI();
|
||||
updatedLinesStart = 0;
|
||||
updatedLinesEnd = lines.Count - 1;
|
||||
}
|
||||
|
||||
private string GetSettingStatus(int option)
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
case 0:
|
||||
return settings.EnableSmartIndent ? "ON " : "OFF";
|
||||
case 1:
|
||||
return settings.EnableAutoCompleteBrackets ? "ON " : "OFF";
|
||||
case 2:
|
||||
return settings.EnableAutoCompleteQuotes ? "ON " : "OFF";
|
||||
case 3:
|
||||
return settings.EnableSmartDelete ? "ON " : "OFF";
|
||||
case 4:
|
||||
return settings.EnableSyntaxHighlight ? "ON " : "OFF";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSetting(int option)
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
case 0:
|
||||
settings.EnableSmartIndent = !settings.EnableSmartIndent;
|
||||
break;
|
||||
case 1:
|
||||
settings.EnableAutoCompleteBrackets = !settings.EnableAutoCompleteBrackets;
|
||||
break;
|
||||
case 2:
|
||||
settings.EnableAutoCompleteQuotes = !settings.EnableAutoCompleteQuotes;
|
||||
break;
|
||||
case 3:
|
||||
settings.EnableSmartDelete = !settings.EnableSmartDelete;
|
||||
break;
|
||||
case 4:
|
||||
settings.EnableSyntaxHighlight = !settings.EnableSyntaxHighlight;
|
||||
break;
|
||||
case 5:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
|
||||
settings.Load(@"0:\system\nano.dat");
|
||||
|
||||
RenderUI();
|
||||
while (!quit)
|
||||
{
|
||||
@@ -826,6 +1503,8 @@ namespace CMLeonOS
|
||||
HandleInput();
|
||||
UpdateScrolling();
|
||||
}
|
||||
|
||||
settings.Save(@"0:\system\nano.dat");
|
||||
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
|
||||
45
example.bran
45
example.bran
@@ -1,45 +0,0 @@
|
||||
# Branswe代码示例
|
||||
# 这个文件展示了Branswe编程语言的基本功能
|
||||
|
||||
# 示例1:简单的Hello World
|
||||
conshow hello
|
||||
var(text) hello = Hello, Branswe!
|
||||
|
||||
# 示例2:变量操作
|
||||
var() name = LeonOS
|
||||
var(text) greeting = Hello, name!
|
||||
conshow greeting
|
||||
|
||||
# 示例3:条件判断
|
||||
if hello == hello
|
||||
then
|
||||
conshow match
|
||||
else
|
||||
conshow no match
|
||||
end
|
||||
|
||||
# 示例4:循环
|
||||
loop 5
|
||||
conshow count: i
|
||||
var(text) count = i
|
||||
conshow count: count
|
||||
end
|
||||
|
||||
# 示例5:计算
|
||||
var(text) result = 10
|
||||
var(text) num1 = 5
|
||||
var(text) num2 = 3
|
||||
rstr result + num1 + num2
|
||||
conshow result
|
||||
|
||||
# 示例6:扬声器响声
|
||||
conbeep
|
||||
|
||||
# 示例7:睡眠
|
||||
sleep 1000
|
||||
|
||||
# 示例8:清屏
|
||||
concls
|
||||
|
||||
# 示例9:结束
|
||||
end
|
||||
@@ -39,6 +39,7 @@ namespace UniLua
|
||||
new NameFuncPair("base64decrypt", OS_Base64Decrypt),
|
||||
new NameFuncPair("timerstart", OS_TimerStart),
|
||||
new NameFuncPair("timerstop", OS_TimerStop),
|
||||
new NameFuncPair("osversion", OS_Osversion),
|
||||
new NameFuncPair("tui_drawbox", OS_TUIDrawBox),
|
||||
new NameFuncPair("tui_drawtext", OS_TUIDrawText),
|
||||
new NameFuncPair("tui_setcolor", OS_TUISetColor),
|
||||
@@ -117,7 +118,7 @@ namespace UniLua
|
||||
return 1;
|
||||
}
|
||||
|
||||
CMLeonOS.Kernel.shell?.ExecuteCommand(command);
|
||||
CMLeonOS.Kernel.ExecuteCommand(command);
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
@@ -131,7 +132,7 @@ namespace UniLua
|
||||
return 1;
|
||||
}
|
||||
|
||||
CMLeonOS.Kernel.shell?.ExecuteCommand($"com {filePath}");
|
||||
CMLeonOS.Kernel.ExecuteCommand($"com {filePath}");
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
@@ -240,6 +241,13 @@ namespace UniLua
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_Osversion(ILuaState lua)
|
||||
{
|
||||
string version = CMLeonOS.Version.FullVersion;
|
||||
lua.PushString(version);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUIDrawBox(ILuaState lua)
|
||||
{
|
||||
int x = (int)lua.L_CheckNumber(1);
|
||||
|
||||
@@ -163,15 +163,15 @@ namespace CMLeonOS.shell
|
||||
case "uptime":
|
||||
shell.ShowUptime();
|
||||
break;
|
||||
case "ps":
|
||||
shell.ShowProcesses();
|
||||
break;
|
||||
case "kill":
|
||||
shell.KillProcess(args);
|
||||
break;
|
||||
case "grep":
|
||||
shell.GrepFile(args);
|
||||
break;
|
||||
case "backup":
|
||||
shell.BackupSystem(args);
|
||||
break;
|
||||
case "restore":
|
||||
shell.RestoreSystem(args);
|
||||
break;
|
||||
case "ftp":
|
||||
shell.CreateFTP();
|
||||
break;
|
||||
@@ -196,6 +196,12 @@ namespace CMLeonOS.shell
|
||||
case "lua":
|
||||
shell.ExecuteLuaScript(args);
|
||||
break;
|
||||
case "lua2cla":
|
||||
shell.ConvertLuaToCla(args);
|
||||
break;
|
||||
case "cla":
|
||||
shell.RunClaFile(args);
|
||||
break;
|
||||
case "testgui":
|
||||
shell.ProcessTestGui();
|
||||
break;
|
||||
@@ -208,6 +214,9 @@ namespace CMLeonOS.shell
|
||||
case "snake":
|
||||
shell.PlaySnake();
|
||||
break;
|
||||
case "hex":
|
||||
shell.EditHexFile(args);
|
||||
break;
|
||||
case "alias":
|
||||
shell.ProcessAlias(args);
|
||||
break;
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace CMLeonOS.Commands.Editor
|
||||
|
||||
try
|
||||
{
|
||||
var editor = new CMLeonOS.Editor(fileName, fileSystem);
|
||||
editor.Run();
|
||||
var nano = new CMLeonOS.Nano(fileName, true, fileSystem);
|
||||
nano.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -260,6 +260,18 @@ namespace CMLeonOS.Commands
|
||||
Description = "Show system uptime"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "ps",
|
||||
Parameters = "",
|
||||
Description = "List all running processes"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "kill",
|
||||
Parameters = "<process_id>",
|
||||
Description = "Kill a process by ID"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "matrix",
|
||||
Parameters = "",
|
||||
@@ -278,24 +290,18 @@ namespace CMLeonOS.Commands
|
||||
Description = "Execute Branswe code file"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "backup",
|
||||
Parameters = "<name>",
|
||||
Description = "Backup system files"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "restore",
|
||||
Parameters = "<name>",
|
||||
Description = "Restore system files"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "grep",
|
||||
Parameters = "<pattern> <file>",
|
||||
Description = "Search text in file"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "hex",
|
||||
Parameters = "<filename>",
|
||||
Description = "Hexadecimal file editor"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "ping",
|
||||
Parameters = "<ip>",
|
||||
@@ -381,6 +387,18 @@ namespace CMLeonOS.Commands
|
||||
Description = "Execute Lua script"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "lua2cla",
|
||||
Parameters = "<lua_file>",
|
||||
Description = "Convert Lua to CLA format"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "cla",
|
||||
Parameters = "<cla_file>",
|
||||
Description = "Run CLA application"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "version",
|
||||
Parameters = "",
|
||||
@@ -403,7 +421,7 @@ namespace CMLeonOS.Commands
|
||||
{
|
||||
Command = "help",
|
||||
Parameters = "<page>",
|
||||
Description = "Show help page (1-3)",
|
||||
Description = "Show help page (1-5)",
|
||||
SubCommands = new[] { new SubCommandInfo { Command = "help all", Description = "Show all help pages" } }
|
||||
}
|
||||
};
|
||||
@@ -483,24 +501,32 @@ namespace CMLeonOS.Commands
|
||||
pageNumber = 1;
|
||||
}
|
||||
|
||||
int startIndex = (pageNumber - 1) * CommandsPerPage;
|
||||
int endIndex = Math.Min(startIndex + CommandsPerPage, allCommands.Count);
|
||||
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine($" Help - Page {pageNumber}/{totalPages}");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine();
|
||||
|
||||
int linesOnPage = 0;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
int currentLine = 0;
|
||||
|
||||
for (int i = 0; i < allCommands.Count; i++)
|
||||
{
|
||||
int cmdLines = GetCommandLinesCount(allCommands[i]);
|
||||
if (linesOnPage + cmdLines > CommandsPerPage)
|
||||
|
||||
if (currentLine + cmdLines <= (pageNumber - 1) * CommandsPerPage)
|
||||
{
|
||||
currentLine += cmdLines;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (linesOnPage >= CommandsPerPage)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
DisplayCommand(allCommands[i]);
|
||||
linesOnPage += cmdLines;
|
||||
currentLine += cmdLines;
|
||||
}
|
||||
|
||||
if (pageNumber < totalPages)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CMLeonOS.Commands
|
||||
public static void ProcessAbout()
|
||||
{
|
||||
Console.WriteLine("CMLeonOS Project");
|
||||
Console.WriteLine("By LeonOS 2 Developement Team");
|
||||
Console.WriteLine("By LeonOS 2 Developer Team");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
using System;
|
||||
using IL2CPU.API.Attribs;
|
||||
|
||||
namespace CMLeonOS.Commands
|
||||
{
|
||||
public static class VersionCommand
|
||||
{
|
||||
[ManifestResourceStream(ResourceName = "CMLeonOS.BuildTime.txt")]
|
||||
private static byte[] buildTimeResource;
|
||||
|
||||
public static void ProcessVersion()
|
||||
{
|
||||
string buildTime = global::System.Text.Encoding.UTF8.GetString(buildTimeResource);
|
||||
Console.WriteLine(Version.DisplayVersionWithGit);
|
||||
Console.WriteLine($"Major: {Version.Major}");
|
||||
Console.WriteLine($"Minor: {Version.Minor}");
|
||||
@@ -13,6 +18,7 @@ namespace CMLeonOS.Commands
|
||||
Console.WriteLine($"Type: {Version.VersionType}");
|
||||
Console.WriteLine($"Full Version: {Version.FullVersion}");
|
||||
Console.WriteLine($"Git Commit: {Version.GitCommit}");
|
||||
Console.WriteLine($"Build Time: {buildTime}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
82
shell/Commands/Script/ClaCommand.cs
Normal file
82
shell/Commands/Script/ClaCommand.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UniLua;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
public static class ClaCommand
|
||||
{
|
||||
private const string FILE_HEADER = "CMLeonOS_CLA";
|
||||
private static readonly byte[] ENCRYPTION_KEY = { 0x55, 0xAA, 0x33, 0xCC, 0x77, 0x88, 0x11, 0x22, 0x44, 0x66, 0x99, 0xBB };
|
||||
|
||||
public static void RunClaFile(string args, CMLeonOS.FileSystem fileSystem, Shell shell, Action<string> showError, Action<string> showWarning)
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError(UsageGenerator.GenerateSimpleUsage("cla", "<cla_file>"));
|
||||
showError("Example: cla app.cla");
|
||||
return;
|
||||
}
|
||||
|
||||
string claFilePath = fileSystem.GetFullPath(args);
|
||||
|
||||
if (!File.Exists(claFilePath))
|
||||
{
|
||||
showError($"Error: CLA file not found: {args}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!claFilePath.EndsWith(".cla", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
showError("Error: Input file must have .cla extension");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string luaContent = DecryptClaFile(claFilePath);
|
||||
|
||||
if (string.IsNullOrEmpty(luaContent))
|
||||
{
|
||||
showError("Error: Failed to decrypt CLA file or file is corrupted");
|
||||
return;
|
||||
}
|
||||
|
||||
LuaCommand.ExecuteLuaCode(luaContent, fileSystem, shell, showError, showWarning);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error running CLA file: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static string DecryptClaFile(string claFilePath)
|
||||
{
|
||||
using (BinaryReader reader = new BinaryReader(File.OpenRead(claFilePath)))
|
||||
{
|
||||
byte[] headerBytes = reader.ReadBytes(FILE_HEADER.Length);
|
||||
string header = Encoding.ASCII.GetString(headerBytes);
|
||||
|
||||
if (header != FILE_HEADER)
|
||||
{
|
||||
throw new Exception("Invalid CLA file format: Missing or incorrect header");
|
||||
}
|
||||
|
||||
byte[] encryptedData = reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position));
|
||||
return DecryptData(encryptedData);
|
||||
}
|
||||
}
|
||||
|
||||
private static string DecryptData(byte[] data)
|
||||
{
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
int keyIndex = i % ENCRYPTION_KEY.Length;
|
||||
data[i] = (byte)(data[i] ^ ENCRYPTION_KEY[keyIndex]);
|
||||
}
|
||||
|
||||
return Encoding.UTF8.GetString(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
70
shell/Commands/Script/Lua2ClaCommand.cs
Normal file
70
shell/Commands/Script/Lua2ClaCommand.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
public static class Lua2ClaCommand
|
||||
{
|
||||
private const string FILE_HEADER = "CMLeonOS_CLA";
|
||||
private static readonly byte[] ENCRYPTION_KEY = { 0x55, 0xAA, 0x33, 0xCC, 0x77, 0x88, 0x11, 0x22, 0x44, 0x66, 0x99, 0xBB };
|
||||
|
||||
public static void ConvertLuaToCla(string args, CMLeonOS.FileSystem fileSystem, Action<string> showError, Action<string> showSuccess)
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError(UsageGenerator.GenerateSimpleUsage("lua2cla", "<lua_file>"));
|
||||
showError("Example: lua2cla app.lua");
|
||||
return;
|
||||
}
|
||||
|
||||
string luaFilePath = fileSystem.GetFullPath(args);
|
||||
|
||||
if (!File.Exists(luaFilePath))
|
||||
{
|
||||
showError($"Error: Lua file not found: {args}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!luaFilePath.EndsWith(".lua", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
showError("Error: Input file must have .lua extension");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string luaContent = File.ReadAllText(luaFilePath);
|
||||
byte[] encryptedData = EncryptData(luaContent);
|
||||
|
||||
string claFilePath = luaFilePath.Substring(0, luaFilePath.Length - 4) + ".cla";
|
||||
|
||||
using (BinaryWriter writer = new BinaryWriter(File.Create(claFilePath)))
|
||||
{
|
||||
writer.Write(Encoding.ASCII.GetBytes(FILE_HEADER));
|
||||
writer.Write(encryptedData);
|
||||
}
|
||||
|
||||
showSuccess($"Successfully converted: {args} -> {Path.GetFileName(claFilePath)}");
|
||||
Console.WriteLine($"Output file: {claFilePath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error converting file: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] EncryptData(string content)
|
||||
{
|
||||
byte[] data = Encoding.UTF8.GetBytes(content);
|
||||
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
int keyIndex = i % ENCRYPTION_KEY.Length;
|
||||
data[i] = (byte)(data[i] ^ ENCRYPTION_KEY[keyIndex]);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,6 +116,60 @@ namespace CMLeonOS.Commands.Script
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExecuteLuaCode(string code, CMLeonOS.FileSystem fileSystem, Shell shell, Action<string> showError, Action<string> showWarning)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(code))
|
||||
{
|
||||
showWarning("Lua code is empty");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ILuaState lua = LuaAPI.NewState();
|
||||
lua.L_OpenLibs();
|
||||
|
||||
UniLua.ThreadStatus loadResult = lua.L_LoadString(code);
|
||||
|
||||
if (loadResult == UniLua.ThreadStatus.LUA_OK)
|
||||
{
|
||||
UniLua.ThreadStatus callResult = lua.PCall(0, 0, 0);
|
||||
|
||||
if (callResult == UniLua.ThreadStatus.LUA_OK)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorMsg = lua.ToString(-1);
|
||||
if (string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
showError($"Script execution error: Unknown error");
|
||||
}
|
||||
else
|
||||
{
|
||||
showError($"Script execution error: {errorMsg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorMsg = lua.ToString(-1);
|
||||
if (string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
showError($"Script load error: Unknown error");
|
||||
}
|
||||
else
|
||||
{
|
||||
showError($"Script load error: {errorMsg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Lua execution error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnterLuaShell(Action<string> showError)
|
||||
{
|
||||
Console.WriteLine("====================================");
|
||||
|
||||
57
shell/Commands/System/KillCommand.cs
Normal file
57
shell/Commands/System/KillCommand.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
|
||||
namespace CMLeonOS.Commands.System
|
||||
{
|
||||
public static class KillCommand
|
||||
{
|
||||
public static void KillProcess(string args, Action<string> showError, Action<string> showWarning)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(args))
|
||||
{
|
||||
showError("Usage: kill <process_id>");
|
||||
showError("Example: kill 123");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ulong.TryParse(args, out ulong processId))
|
||||
{
|
||||
showError($"Invalid process ID: {args}");
|
||||
showError("Process ID must be a number.");
|
||||
return;
|
||||
}
|
||||
|
||||
Process process = ProcessManager.GetProcessById(processId);
|
||||
if (process == null)
|
||||
{
|
||||
showError($"Process not found: {processId}");
|
||||
showError("Use 'ps' command to list all processes.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.Name == "Shell")
|
||||
{
|
||||
showError("Cannot kill Shell process.");
|
||||
showError("Use 'exit' command instead.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!process.IsRunning)
|
||||
{
|
||||
showWarning($"Process {process.Name} ({processId}) is already stopped.");
|
||||
return;
|
||||
}
|
||||
|
||||
CMLeonOS.Logger.Logger.Instance.Info("Kill", $"Killing process: {process.Name} ({processId})");
|
||||
process.TryStop();
|
||||
|
||||
Console.WriteLine($"Process {process.Name} ({processId}) stopped successfully.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error killing process: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
shell/Commands/System/PsCommand.cs
Normal file
57
shell/Commands/System/PsCommand.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
|
||||
namespace CMLeonOS.Commands.System
|
||||
{
|
||||
public static class PsCommand
|
||||
{
|
||||
public static void ShowProcesses(Action<string> showError, Action<string> showWarning)
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine(" Process List");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine();
|
||||
|
||||
if (ProcessManager.Processes.Count == 0)
|
||||
{
|
||||
Console.WriteLine("No processes running.");
|
||||
Console.WriteLine();
|
||||
return;
|
||||
}
|
||||
|
||||
Console.Write("ID ");
|
||||
Console.Write("Name ");
|
||||
Console.Write("Type ");
|
||||
Console.Write("Parent ");
|
||||
Console.WriteLine("Status ");
|
||||
Console.WriteLine("----------------------------------------------------------------------");
|
||||
|
||||
foreach (var process in ProcessManager.Processes)
|
||||
{
|
||||
string parentId = process.Parent != null ? process.Parent.Id.ToString() : "N/A";
|
||||
string status = process.IsRunning ? "Running" : "Stopped";
|
||||
string type = process.Type.ToString();
|
||||
|
||||
Console.Write(process.Id.ToString().PadRight(8));
|
||||
Console.Write(" ");
|
||||
Console.Write(process.Name.PadRight(20));
|
||||
Console.Write(" ");
|
||||
Console.Write(type.PadRight(12));
|
||||
Console.Write(" ");
|
||||
Console.Write(parentId.PadRight(8));
|
||||
Console.Write(" ");
|
||||
Console.WriteLine(status);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Total processes: " + ProcessManager.Processes.Count);
|
||||
Console.WriteLine();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error listing processes: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,18 @@ namespace CMLeonOS.Commands
|
||||
Console.WriteLine("Error: LoggerEnabled must be 'true' or 'false'");
|
||||
}
|
||||
}
|
||||
else if (key.ToLower() == "maxloginattempts")
|
||||
{
|
||||
if (int.TryParse(value, out int attempts) && attempts > 0)
|
||||
{
|
||||
SettingsManager.MaxLoginAttempts = attempts;
|
||||
Console.WriteLine($"MaxLoginAttempts set to {attempts}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Error: MaxLoginAttempts must be a positive integer");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsManager.SetSetting(key, value);
|
||||
|
||||
@@ -8,6 +8,19 @@ namespace CMLeonOS.Commands.User
|
||||
{
|
||||
private static CMLeonOS.UserSystem userSystem;
|
||||
|
||||
private static bool ContainsInvalidChars(string input)
|
||||
{
|
||||
char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*', '/', '\\' };
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (input.Contains(c.ToString()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void SetUserSystem(CMLeonOS.UserSystem system)
|
||||
{
|
||||
userSystem = system;
|
||||
@@ -80,6 +93,12 @@ namespace CMLeonOS.Commands.User
|
||||
string password = parts[3];
|
||||
bool isAdmin = userType == "admin";
|
||||
|
||||
if (ContainsInvalidChars(username))
|
||||
{
|
||||
showError("Error: Username contains invalid characters: < > : \" | ? / \\");
|
||||
return;
|
||||
}
|
||||
|
||||
userSystem.AddUser($"{username} {password}", isAdmin);
|
||||
}
|
||||
else if (subCommand == "delete")
|
||||
|
||||
49
shell/Commands/Utility/HexCommand.cs
Normal file
49
shell/Commands/Utility/HexCommand.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
public static class HexCommand
|
||||
{
|
||||
public static void EditHexFile(string args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(args))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine("Usage: hex <filename>");
|
||||
Console.WriteLine("Example: hex test.bin");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Controls:");
|
||||
Console.WriteLine(" Arrow Keys - Move cursor");
|
||||
Console.WriteLine(" Page Up/Down - Scroll view");
|
||||
Console.WriteLine(" 0-9, A-F - Edit byte");
|
||||
Console.WriteLine(" S - Save file");
|
||||
Console.WriteLine(" Q - Quit");
|
||||
Console.ResetColor();
|
||||
return;
|
||||
}
|
||||
|
||||
string filePath = args.Trim();
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"File not found: {filePath}");
|
||||
Console.ResetColor();
|
||||
return;
|
||||
}
|
||||
|
||||
var editor = new HexEditor(filePath);
|
||||
editor.Run();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"Error opening hex editor: {ex.Message}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
258
shell/Commands/Utility/HexEditor.cs
Normal file
258
shell/Commands/Utility/HexEditor.cs
Normal file
@@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
public class HexEditor
|
||||
{
|
||||
private byte[] data;
|
||||
private int cursorPosition;
|
||||
private int viewOffset;
|
||||
private int bytesPerLine = 16;
|
||||
private int bytesPerGroup = 2;
|
||||
private string filePath;
|
||||
private bool modified;
|
||||
private bool running;
|
||||
|
||||
public HexEditor(string path)
|
||||
{
|
||||
filePath = path;
|
||||
if (File.Exists(path))
|
||||
{
|
||||
data = File.ReadAllBytes(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new byte[256];
|
||||
}
|
||||
cursorPosition = 0;
|
||||
viewOffset = 0;
|
||||
modified = false;
|
||||
running = true;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine(" Hex Editor");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("File: " + filePath);
|
||||
Console.WriteLine("Size: " + data.Length + " bytes");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Controls:");
|
||||
Console.WriteLine(" Arrow Keys - Move cursor");
|
||||
Console.WriteLine(" Page Up/Down - Scroll view");
|
||||
Console.WriteLine(" 0-9, A-F - Edit byte");
|
||||
Console.WriteLine(" S - Save file");
|
||||
Console.WriteLine(" Q - Quit");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press any key to continue...");
|
||||
Console.ReadKey(true);
|
||||
|
||||
while (running)
|
||||
{
|
||||
Display();
|
||||
HandleInput();
|
||||
}
|
||||
}
|
||||
|
||||
private void Display()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine(" Hex Editor");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("File: " + filePath);
|
||||
Console.WriteLine("Size: " + data.Length + " bytes");
|
||||
if (modified)
|
||||
{
|
||||
Console.Write(" [MODIFIED]");
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
|
||||
int lines = (int)Math.Ceiling((double)data.Length / bytesPerLine);
|
||||
int startLine = viewOffset / bytesPerLine;
|
||||
int endLine = Math.Min(startLine + 20, lines);
|
||||
|
||||
for (int line = startLine; line < endLine; line++)
|
||||
{
|
||||
int offset = line * bytesPerLine;
|
||||
if (offset >= data.Length) break;
|
||||
|
||||
Console.Write(offset.ToString("X8") + " ");
|
||||
|
||||
for (int i = 0; i < bytesPerLine; i++)
|
||||
{
|
||||
int byteOffset = offset + i;
|
||||
if (byteOffset >= data.Length)
|
||||
{
|
||||
Console.Write(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
byte b = data[byteOffset];
|
||||
bool isCursor = (byteOffset == cursorPosition);
|
||||
|
||||
if (isCursor)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.White;
|
||||
Console.ForegroundColor = ConsoleColor.Black;
|
||||
}
|
||||
|
||||
Console.Write(b.ToString("X2") + " ");
|
||||
|
||||
if (isCursor)
|
||||
{
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
if ((i + 1) % bytesPerGroup == 0)
|
||||
{
|
||||
Console.Write(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Console.Write(" |");
|
||||
|
||||
for (int i = 0; i < bytesPerLine; i++)
|
||||
{
|
||||
int byteOffset = offset + i;
|
||||
if (byteOffset >= data.Length)
|
||||
{
|
||||
Console.Write(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
byte b = data[byteOffset];
|
||||
bool isCursor = (byteOffset == cursorPosition);
|
||||
|
||||
if (isCursor)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.White;
|
||||
Console.ForegroundColor = ConsoleColor.Black;
|
||||
}
|
||||
|
||||
char c = (b >= 32 && b <= 126) ? (char)b : '.';
|
||||
Console.Write(c);
|
||||
|
||||
if (isCursor)
|
||||
{
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("|");
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Cursor: 0x" + cursorPosition.ToString("X8") + " (" + cursorPosition + ")");
|
||||
Console.WriteLine("Value: 0x" + data[cursorPosition].ToString("X2"));
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Controls:");
|
||||
Console.WriteLine(" Arrow Keys - Move cursor");
|
||||
Console.WriteLine(" Page Up/Down - Scroll view");
|
||||
Console.WriteLine(" 0-9, A-F - Edit byte");
|
||||
Console.WriteLine(" S - Save file");
|
||||
Console.WriteLine(" Q - Quit");
|
||||
}
|
||||
|
||||
private void HandleInput()
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
switch (key.Key)
|
||||
{
|
||||
case ConsoleKey.UpArrow:
|
||||
cursorPosition = Math.Max(0, cursorPosition - bytesPerLine);
|
||||
break;
|
||||
case ConsoleKey.DownArrow:
|
||||
cursorPosition = Math.Min(data.Length - 1, cursorPosition + bytesPerLine);
|
||||
break;
|
||||
case ConsoleKey.LeftArrow:
|
||||
cursorPosition = Math.Max(0, cursorPosition - 1);
|
||||
break;
|
||||
case ConsoleKey.RightArrow:
|
||||
cursorPosition = Math.Min(data.Length - 1, cursorPosition + 1);
|
||||
break;
|
||||
case ConsoleKey.PageUp:
|
||||
viewOffset = Math.Max(0, viewOffset - (bytesPerLine * 20));
|
||||
break;
|
||||
case ConsoleKey.PageDown:
|
||||
viewOffset = Math.Min(data.Length - 1, viewOffset + (bytesPerLine * 20));
|
||||
break;
|
||||
case ConsoleKey.D0:
|
||||
case ConsoleKey.D1:
|
||||
case ConsoleKey.D2:
|
||||
case ConsoleKey.D3:
|
||||
case ConsoleKey.D4:
|
||||
case ConsoleKey.D5:
|
||||
case ConsoleKey.D6:
|
||||
case ConsoleKey.D7:
|
||||
case ConsoleKey.D8:
|
||||
case ConsoleKey.D9:
|
||||
int digit = key.KeyChar - '0';
|
||||
EditByte(digit);
|
||||
break;
|
||||
case ConsoleKey.A:
|
||||
EditByte(10);
|
||||
break;
|
||||
case ConsoleKey.B:
|
||||
EditByte(11);
|
||||
break;
|
||||
case ConsoleKey.C:
|
||||
EditByte(12);
|
||||
break;
|
||||
case ConsoleKey.D:
|
||||
EditByte(13);
|
||||
break;
|
||||
case ConsoleKey.E:
|
||||
EditByte(14);
|
||||
break;
|
||||
case ConsoleKey.F:
|
||||
EditByte(15);
|
||||
break;
|
||||
case ConsoleKey.S:
|
||||
SaveFile();
|
||||
break;
|
||||
case ConsoleKey.Q:
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void EditByte(int value)
|
||||
{
|
||||
if (cursorPosition >= 0 && cursorPosition < data.Length)
|
||||
{
|
||||
data[cursorPosition] = (byte)value;
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(filePath, data);
|
||||
modified = false;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("File saved successfully!");
|
||||
Console.WriteLine("Press any key to continue...");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Error saving file: " + ex.Message);
|
||||
Console.WriteLine("Press any key to continue...");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
203
shell/Shell.cs
203
shell/Shell.cs
@@ -128,7 +128,7 @@ namespace CMLeonOS
|
||||
{
|
||||
var command = parts[0].Trim().ToLower();
|
||||
var args = parts.Length > 1 ? string.Join(" ", parts, 1, parts.Length - 1).Trim() : "";
|
||||
ProcessCommand(command, args);
|
||||
ProcessCommandAsProcess(command, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,9 +407,9 @@ namespace CMLeonOS
|
||||
"rmdir", "cat", "version", "about", "head", "tail", "wc", "cp",
|
||||
"mv", "rename", "touch", "find", "tree", "grep", "getdisk", "user",
|
||||
"cpass", "hostname", "ipconfig", "setdns", "setgateway", "nslookup",
|
||||
"ping", "wget", "ftp", "tcpserver", "tcpclient", "lua", "branswe",
|
||||
"beep", "backup", "restore", "env", "whoami", "uptime", "alias",
|
||||
"unalias", "base64", "testgui"
|
||||
"ping", "wget", "ftp", "tcpserver", "tcpclient", "lua", "lua2cla", "cla",
|
||||
"branswe", "beep", "env", "whoami", "uptime", "alias",
|
||||
"unalias", "base64", "testgui", "ps", "kill", "hex"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -462,6 +462,59 @@ namespace CMLeonOS
|
||||
shell.CommandList.ProcessCommand(this, expandedCommand, expandedArgs);
|
||||
}
|
||||
|
||||
public void ProcessCommandAsProcess(string command, string args)
|
||||
{
|
||||
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)
|
||||
{
|
||||
var aliasParts = aliasValue.Split(new char[] { ' ' }, 2, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (aliasParts.Length > 0)
|
||||
{
|
||||
expandedCommand = aliasParts[0];
|
||||
if (aliasParts.Length > 1)
|
||||
{
|
||||
expandedArgs = aliasParts[1] + (string.IsNullOrEmpty(args) ? "" : " " + args);
|
||||
}
|
||||
else
|
||||
{
|
||||
expandedArgs = args;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var commandProcess = new CommandProcess(expandedCommand, expandedArgs, this);
|
||||
ProcessManager.AddProcess(commandProcess);
|
||||
commandProcess.TryStart();
|
||||
commandProcess.TryRun();
|
||||
commandProcess.TryStop();
|
||||
}
|
||||
|
||||
public void ProcessEcho(string args)
|
||||
{
|
||||
Commands.System.EchoCommand.ProcessEcho(args);
|
||||
@@ -936,123 +989,6 @@ namespace CMLeonOS
|
||||
Commands.Environment.EnvCommand.ProcessEnvCommand(args, envManager, ShowError);
|
||||
}
|
||||
|
||||
public void BackupSystem(string args)
|
||||
{
|
||||
string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
ShowError("Error: Please specify backup name");
|
||||
ShowError("Usage: backup <backupname>");
|
||||
return;
|
||||
}
|
||||
|
||||
string backupName = parts[0];
|
||||
string backupPath = $@"0:\backup\{backupName}";
|
||||
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: Creating backup '{backupName}'");
|
||||
Console.WriteLine($"Backup path: {backupPath}");
|
||||
|
||||
if (Directory.Exists(backupPath))
|
||||
{
|
||||
ShowWarning($"Backup '{backupName}' already exists");
|
||||
ShowWarning("Returning without creating new backup");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"BackupSystem: Creating backup directory: {backupPath}");
|
||||
Directory.CreateDirectory(backupPath);
|
||||
ShowSuccess($"Backup directory created");
|
||||
|
||||
// 备份系统文件
|
||||
string sysPath = @"0:\system";
|
||||
Console.WriteLine($"BackupSystem: Checking system path: {sysPath}");
|
||||
Console.WriteLine($"BackupSystem: System path exists: {Directory.Exists(sysPath)}");
|
||||
|
||||
if (Directory.Exists(sysPath))
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: Copying system files to backup");
|
||||
CopyDirectory(sysPath, backupPath);
|
||||
Console.WriteLine($"BackupSystem: System files copied");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: System path does not exist, skipping system backup");
|
||||
}
|
||||
|
||||
// 备份用户文件
|
||||
string userPath = @"0:\user";
|
||||
Console.WriteLine($"BackupSystem: Checking user path: {userPath}");
|
||||
Console.WriteLine($"BackupSystem: User path exists: {Directory.Exists(userPath)}");
|
||||
|
||||
if (Directory.Exists(userPath))
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: Copying user files to backup");
|
||||
CopyDirectory(userPath, backupPath);
|
||||
Console.WriteLine($"BackupSystem: User files copied");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: User path does not exist, skipping user backup");
|
||||
}
|
||||
|
||||
ShowSuccess($"Backup '{backupName}' created successfully");
|
||||
ShowSuccess($"Backup location: {backupPath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error creating backup: {ex.Message}");
|
||||
ShowError($"Exception type: {ex.GetType().Name}");
|
||||
}
|
||||
}
|
||||
|
||||
public void RestoreSystem(string args)
|
||||
{
|
||||
string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
ShowError("Error: Please specify backup name");
|
||||
ShowError("Usage: restore <backupname>");
|
||||
return;
|
||||
}
|
||||
|
||||
string backupName = parts[0];
|
||||
string backupPath = $@"0:\backup\{backupName}";
|
||||
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(backupPath))
|
||||
{
|
||||
ShowError($"Error: Backup '{backupName}' not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// 恢复系统文件
|
||||
string sysPath = @"0:\system";
|
||||
if (Directory.Exists(backupPath))
|
||||
{
|
||||
CopyDirectory(backupPath, sysPath, true);
|
||||
}
|
||||
|
||||
// 恢复用户文件
|
||||
string userPath = @"0:\user";
|
||||
if (Directory.Exists(backupPath))
|
||||
{
|
||||
CopyDirectory(backupPath, userPath, true);
|
||||
}
|
||||
|
||||
ShowSuccess($"Backup '{backupName}' restored successfully");
|
||||
ShowSuccess($"Backup location: {backupPath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error restoring backup: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyDirectory(string sourcePath, string destPath, bool overwrite = false)
|
||||
{
|
||||
try
|
||||
@@ -1120,6 +1056,21 @@ namespace CMLeonOS
|
||||
Commands.System.UptimeCommand.ShowUptime(ShowError, ShowWarning);
|
||||
}
|
||||
|
||||
public void ShowProcesses()
|
||||
{
|
||||
Commands.System.PsCommand.ShowProcesses(ShowError, ShowWarning);
|
||||
}
|
||||
|
||||
public void KillProcess(string args)
|
||||
{
|
||||
Commands.System.KillCommand.KillProcess(args, ShowError, ShowWarning);
|
||||
}
|
||||
|
||||
public void EditHexFile(string args)
|
||||
{
|
||||
Commands.Utility.HexCommand.EditHexFile(args);
|
||||
}
|
||||
|
||||
public void CreateFTP()
|
||||
{
|
||||
Console.WriteLine("====================================");
|
||||
@@ -1619,6 +1570,16 @@ namespace CMLeonOS
|
||||
Commands.Script.LuaCommand.ExecuteLuaScript(args, fileSystem, this, ShowError, ShowWarning);
|
||||
}
|
||||
|
||||
public void ConvertLuaToCla(string args)
|
||||
{
|
||||
Commands.Script.Lua2ClaCommand.ConvertLuaToCla(args, fileSystem, ShowError, ShowSuccess);
|
||||
}
|
||||
|
||||
public void RunClaFile(string args)
|
||||
{
|
||||
Commands.Script.ClaCommand.RunClaFile(args, fileSystem, this, ShowError, ShowWarning);
|
||||
}
|
||||
|
||||
public void ProcessTestGui()
|
||||
{
|
||||
Commands.TestGuiCommand.RunTestGui();
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CMLeonOS
|
||||
public static string Major = "1";
|
||||
public static string Minor = "0";
|
||||
public static string Patch = "0";
|
||||
public static string VersionType = "PreRelease";
|
||||
public static string VersionType = "PreRelease 2";
|
||||
public static string GitCommit = "unknown";
|
||||
|
||||
public static string FullVersion
|
||||
|
||||
Reference in New Issue
Block a user