buninu-linux 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSES/Bun-LICENSE.md +84 -0
- package/LICENSES/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/LICENSES/GPL-2.0.txt +338 -0
- package/LICENSES/GPL-3.0.txt +674 -0
- package/LICENSES/LGPL-2.1.txt +501 -0
- package/LICENSES/Linux-syscall-note.txt +25 -0
- package/LICENSES/musl-COPYRIGHT.txt +193 -0
- package/NOTICE.md +184 -0
- package/README.md +537 -0
- package/build-image.sh +44 -0
- package/build-uki.sh +75 -0
- package/fetch-alpine.sh +80 -0
- package/fetch-bun.sh +41 -0
- package/fetch-plus-build.sh +11 -0
- package/hello/build-hello.sh +14 -0
- package/hello/hello.c +50 -0
- package/index.js +235 -0
- package/initramfs/bin/sh +3 -0
- package/initramfs/buninu/.bashrc +11 -0
- package/initramfs/buninu/ARCHITECTURE.md +452 -0
- package/initramfs/buninu/CHANGELOG.md +580 -0
- package/initramfs/buninu/LICENSE +21 -0
- package/initramfs/buninu/README.md +1161 -0
- package/initramfs/buninu/apps/bun/make-bunBin.sh +99 -0
- package/initramfs/buninu/apps/bunmsh/CHANGELOG.md +493 -0
- package/initramfs/buninu/apps/bunmsh/LICENSE +21 -0
- package/initramfs/buninu/apps/bunmsh/LICENSE-MICRO +58 -0
- package/initramfs/buninu/apps/bunmsh/LICENSE-MKSH +295 -0
- package/initramfs/buninu/apps/bunmsh/PORTING.md +192 -0
- package/initramfs/buninu/apps/bunmsh/README.md +1042 -0
- package/initramfs/buninu/apps/bunmsh/bunmsh +7 -0
- package/initramfs/buninu/apps/bunmsh/bunshell.md +61 -0
- package/initramfs/buninu/apps/bunmsh/help/README.md +2237 -0
- package/initramfs/buninu/apps/bunmsh/help/alias.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/basename.md +38 -0
- package/initramfs/buninu/apps/bunmsh/help/builtin.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/bun.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/bunmsh.md +47 -0
- package/initramfs/buninu/apps/bunmsh/help/cat.md +31 -0
- package/initramfs/buninu/apps/bunmsh/help/catfancy.md +35 -0
- package/initramfs/buninu/apps/bunmsh/help/cd.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/chmod.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/clear.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/colon.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/command.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/cp.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/curl.md +181 -0
- package/initramfs/buninu/apps/bunmsh/help/cut.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/date.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/dirname.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/echo.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/env.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/eval.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/exec.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/exit.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/export.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/false.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/find.md +33 -0
- package/initramfs/buninu/apps/bunmsh/help/getopts.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/grep.md +34 -0
- package/initramfs/buninu/apps/bunmsh/help/head.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/kill.md +43 -0
- package/initramfs/buninu/apps/bunmsh/help/ln.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/ls.md +37 -0
- package/initramfs/buninu/apps/bunmsh/help/lsbun.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/lsfancy.md +37 -0
- package/initramfs/buninu/apps/bunmsh/help/md5sum.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/mkdir.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/mktemp.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/mv.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/print.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/printf.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/pspa.md +38 -0
- package/initramfs/buninu/apps/bunmsh/help/pspac.md +57 -0
- package/initramfs/buninu/apps/bunmsh/help/pwd.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/read.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/readonly.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/realpath.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/rm.md +33 -0
- package/initramfs/buninu/apps/bunmsh/help/rmdir.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/sed.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/seq.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/serve.md +50 -0
- package/initramfs/buninu/apps/bunmsh/help/set.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/sha256sum.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/shift.md +23 -0
- package/initramfs/buninu/apps/bunmsh/help/sleep.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/sort.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/source.md +23 -0
- package/initramfs/buninu/apps/bunmsh/help/tab.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/tac.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/tail.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/tee.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/test.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/time.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/touch.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/tr.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/true.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/type.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/umask.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/unalias.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/uname.md +31 -0
- package/initramfs/buninu/apps/bunmsh/help/unset.md +28 -0
- package/initramfs/buninu/apps/bunmsh/help/wc.md +27 -0
- package/initramfs/buninu/apps/bunmsh/help/whence.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/which.md +41 -0
- package/initramfs/buninu/apps/bunmsh/help/yes.md +23 -0
- package/initramfs/buninu/apps/bunmsh/index.js +7 -0
- package/initramfs/buninu/apps/bunmsh/package.json +30 -0
- package/initramfs/buninu/apps/bunmsh/serve.js +468 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/README.md +402 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/assetsHelper.js +371 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/assetsLoader.mjs +85 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/assetsPacker.js +218 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/compiled.js +527 -0
- package/initramfs/buninu/apps/bunmsh/single-exe/entry.mjs +17 -0
- package/initramfs/buninu/apps/bunmsh/src/cat-fancy.js +117 -0
- package/initramfs/buninu/apps/bunmsh/src/cat-operands.js +31 -0
- package/initramfs/buninu/apps/bunmsh/src/completion.js +363 -0
- package/initramfs/buninu/apps/bunmsh/src/curl.js +1191 -0
- package/initramfs/buninu/apps/bunmsh/src/environment.js +61 -0
- package/initramfs/buninu/apps/bunmsh/src/fancy-ls.js +186 -0
- package/initramfs/buninu/apps/bunmsh/src/find.js +119 -0
- package/initramfs/buninu/apps/bunmsh/src/history.js +198 -0
- package/initramfs/buninu/apps/bunmsh/src/main.js +850 -0
- package/initramfs/buninu/apps/bunmsh/src/mouse.js +103 -0
- package/initramfs/buninu/apps/bunmsh/src/shell.js +3932 -0
- package/initramfs/buninu/apps/bunmsh/test/catfancy.test.js +102 -0
- package/initramfs/buninu/apps/bunmsh/test/curl.test.js +335 -0
- package/initramfs/buninu/apps/bunmsh/test/reference-source.sh +1 -0
- package/initramfs/buninu/apps/bunmsh/test/reference.test.js +817 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/README.md +3 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/bad.json +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.json +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.json5 +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.jsonc +2 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.jsonl +2 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.ndjson +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.toml +3 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.ts +15 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.xml +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.yaml +3 -0
- package/initramfs/buninu/apps/bunmsh/test/serve/data.yml +1 -0
- package/initramfs/buninu/apps/bunmsh/test/serve.test.js +241 -0
- package/initramfs/buninu/apps/bunmsh/test/shell.test.js +2092 -0
- package/initramfs/buninu/apps/bunmsh/test/shell1.test.js +1087 -0
- package/initramfs/buninu/apps/bunmsh/test/shell2.test.js +457 -0
- package/initramfs/buninu/apps/bunmsh/test/shell3.test.js +741 -0
- package/initramfs/buninu/apps/bunmsh/test/t.sh +12 -0
- package/initramfs/buninu/apps/bunx/bunx.js +172 -0
- package/initramfs/buninu/apps/cmdlist +48 -0
- package/initramfs/buninu/apps/jsgotty/LICENSE +23 -0
- package/initramfs/buninu/apps/jsgotty/LICENSES/Apache-2.0-zmodem.js.txt +201 -0
- package/initramfs/buninu/apps/jsgotty/NOTICE +21 -0
- package/initramfs/buninu/apps/jsgotty/README.en.md +294 -0
- package/initramfs/buninu/apps/jsgotty/README.md +296 -0
- package/initramfs/buninu/apps/jsgotty/client.mjs +700 -0
- package/initramfs/buninu/apps/jsgotty/env.sh +2 -0
- package/initramfs/buninu/apps/jsgotty/gotty.js +3334 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/.package-lock.json +35 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/LICENSE.md +9 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/README.md +319 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/common.gypi +20 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/except.gypi +25 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/index.js +12 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/napi-inl.h +6607 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/napi.h +3201 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/node_addon_api.gyp +32 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/node_api.gyp +9 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/nothing.c +0 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/package-support.json +21 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/package.json +480 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/README.md +73 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/node-addon-api/tools/eslint-format.js +79 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/LICENSE +20 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/README.md +548 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/browser.js +8 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/index.js +22 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/buffer-util.js +131 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/constants.js +19 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/event-target.js +292 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/extension.js +203 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/limiter.js +55 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/receiver.js +760 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/sender.js +607 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/stream.js +161 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/subprotocol.js +62 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/validation.js +152 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/websocket-server.js +562 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/lib/websocket.js +1407 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/package.json +70 -0
- package/initramfs/buninu/apps/jsgotty/node_modules/ws/wrapper.mjs +21 -0
- package/initramfs/buninu/apps/jsgotty/package-lock.json +46 -0
- package/initramfs/buninu/apps/jsgotty/package.json +19 -0
- package/initramfs/buninu/apps/jsgotty/patches/windowsPtyAgent.js +326 -0
- package/initramfs/buninu/apps/jsgotty/patches/windowsTerminal.js +204 -0
- package/initramfs/buninu/apps/jsgotty/rz.js +199 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/README.md +384 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/assetsHelper.js +371 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/assetsLoader.mjs +85 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/assetsPacker.js +218 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/compiled.js +498 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/entry.mjs +23 -0
- package/initramfs/buninu/apps/jsgotty/single-exe/packAssets.sh +7 -0
- package/initramfs/buninu/apps/jsgotty/static/css/index.css +13 -0
- package/initramfs/buninu/apps/jsgotty/static/css/kitty.css +61 -0
- package/initramfs/buninu/apps/jsgotty/static/css/xterm.css +218 -0
- package/initramfs/buninu/apps/jsgotty/static/css/xterm_customize.css +35 -0
- package/initramfs/buninu/apps/jsgotty/static/favicon.ico +0 -0
- package/initramfs/buninu/apps/jsgotty/static/help.md +125 -0
- package/initramfs/buninu/apps/jsgotty/static/icon.svg +66 -0
- package/initramfs/buninu/apps/jsgotty/static/icon_192.png +0 -0
- package/initramfs/buninu/apps/jsgotty/static/index.html +164 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js +31537 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js.LICENSE.txt +7 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.js.map +1 -0
- package/initramfs/buninu/apps/jsgotty/static/js/gotty.licenses.txt +650 -0
- package/initramfs/buninu/apps/jsgotty/static/js/kitty.js +1101 -0
- package/initramfs/buninu/apps/jsgotty/static/js/windows_bridge.js +194 -0
- package/initramfs/buninu/apps/jsgotty/static/js/xterm-addon-unicode11.js +2 -0
- package/initramfs/buninu/apps/jsgotty/static/js/zmodem.js +1 -0
- package/initramfs/buninu/apps/jsgotty/static/manifest.json +15 -0
- package/initramfs/buninu/apps/jsgotty/sz.js +273 -0
- package/initramfs/buninu/apps/jsgotty/tests/kitty-order.test.js +58 -0
- package/initramfs/buninu/apps/jsgotty/tests/websocket-origin.test.js +54 -0
- package/initramfs/buninu/apps/jsgotty/viu.mjs +422 -0
- package/initramfs/buninu/apps/jsgotty/wgotty +62 -0
- package/initramfs/buninu/apps/jsgotty/windows-bridge-node.js +60 -0
- package/initramfs/buninu/apps/jsgotty/zmodem-node.js +262 -0
- package/initramfs/buninu/apps/jsmdcui/CHANGELOG.md +1118 -0
- package/initramfs/buninu/apps/jsmdcui/LICENSE +22 -0
- package/initramfs/buninu/apps/jsmdcui/README.md +1283 -0
- package/initramfs/buninu/apps/jsmdcui/cdp-maze.js +141 -0
- package/initramfs/buninu/apps/jsmdcui/clean.sh +9 -0
- package/initramfs/buninu/apps/jsmdcui/demos/basic.jpg +0 -0
- package/initramfs/buninu/apps/jsmdcui/demos/chinese.md +32 -0
- package/initramfs/buninu/apps/jsmdcui/demos/event.md +170 -0
- package/initramfs/buninu/apps/jsmdcui/demos/good.jpg +0 -0
- package/initramfs/buninu/apps/jsmdcui/demos/image-processor.md +366 -0
- package/initramfs/buninu/apps/jsmdcui/demos/image-processor.zh-TW.md +366 -0
- package/initramfs/buninu/apps/jsmdcui/demos/img-change.md +73 -0
- package/initramfs/buninu/apps/jsmdcui/demos/imgtool-zh.md +298 -0
- package/initramfs/buninu/apps/jsmdcui/demos/imgtool.md +298 -0
- package/initramfs/buninu/apps/jsmdcui/demos/maze.md +149 -0
- package/initramfs/buninu/apps/jsmdcui/demos/reactive.md +40 -0
- package/initramfs/buninu/apps/jsmdcui/demos/reader.md +513 -0
- package/initramfs/buninu/apps/jsmdcui/demos/select.md +63 -0
- package/initramfs/buninu/apps/jsmdcui/demos/todo-zh.md +190 -0
- package/initramfs/buninu/apps/jsmdcui/demos/todo.md +191 -0
- package/initramfs/buninu/apps/jsmdcui/edit +9 -0
- package/initramfs/buninu/apps/jsmdcui/jsmdcui.sh +16 -0
- package/initramfs/buninu/apps/jsmdcui/llm-maze.txt +94 -0
- package/initramfs/buninu/apps/jsmdcui/package.json +29 -0
- package/initramfs/buninu/apps/jsmdcui/project_structure.txt +35 -0
- package/initramfs/buninu/apps/jsmdcui/runmd.mjs +1140 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/atom-dark.micro +33 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/bubblegum.micro +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/cmc-16.micro +47 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/cmc-tc.micro +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/darcula.micro +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/default.micro +1 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dracula-tc.micro +49 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dukedark-tc.micro +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dukelight-tc.micro +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/geany.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/gotham.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/gruvbox-tc.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/gruvbox.micro +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/material-tc.micro +36 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/monokai-dark.micro +28 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/monokai.micro +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/one-dark.micro +39 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/railscast.micro +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/simple.micro +33 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/solarized-tc.micro +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/solarized.micro +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/sunny-day.micro +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/twilight.micro +40 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/colorschemes/zenburn.micro +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/actions.md +161 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/cdp.md +130 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/colors.md +421 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/commands.md +161 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/copypaste.md +149 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/defaultkeys.md +148 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/help.md +1283 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/keybindings.md +355 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/linter.md +90 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/options.md +709 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/plugins.md +544 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/help/tutorial.md +112 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/cdp/cdp-server.js +1263 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/cdp/cdp.js +203 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/chapter/chapter.js +111 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/diff/diff.js +46 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/example/example.js +117 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/jsplugins/linter/linter.js +281 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/autoclose/autoclose.lua +75 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/ftoptions/ftoptions.lua +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/literate/README.md +5 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/literate/literate.lua +55 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/status/help/status.md +21 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/plugins/status/status.lua +62 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/LICENSE +22 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/PowerShell.yaml +128 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/README.md +63 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ada.yaml +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/apacheconf.yaml +59 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/arduino.yaml +101 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/asciidoc.yaml +51 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/asm.yaml +123 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ats.yaml +99 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/awk.yaml +44 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/b.yaml +87 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/bat.yaml +57 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/c.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/caddyfile.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cake.yaml +7 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/clojure.yaml +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cmake.yaml +42 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/coffeescript.yaml +56 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/colortest.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/conky.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cpp.yaml +91 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/crontab.yaml +36 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/crystal.yaml +72 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/csharp.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/css.yaml +44 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/csx.yaml +8 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cuda.yaml +68 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/cython.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/d.yaml +121 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/dart.yaml +46 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/default.yaml +10 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/dockerfile.yaml +36 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/dot.yaml +29 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/elixir.yaml +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/elm.yaml +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/erb.yaml +42 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/erlang.yaml +45 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/fish.yaml +48 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/forth.yaml +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/fortran.yaml +64 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/freebsd-kernel.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/fsharp.yaml +48 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gdscript.yaml +61 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gemini.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gentoo-ebuild.yaml +48 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gentoo-etc-portage.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/git-commit.yaml +35 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/git-config.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/git-rebase-todo.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gleam.yaml +69 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/glsl.yaml +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gnuplot.yaml +15 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/go.yaml +62 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/godoc.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/golo.yaml +73 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/gomod.yaml +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/graphql.yaml +47 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/groff.yaml +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/groovy.yaml +111 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/haml.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/hare.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/haskell.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/hc.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/html.yaml +70 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/html4.yaml +25 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/html5.yaml +25 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ini.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/inputrc.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/java.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/javascript.yaml +124 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/jinja2.yaml +19 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/json.yaml +39 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/jsonnet.yaml +92 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/julia.yaml +57 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/justfile.yaml +40 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/keymap.yaml +27 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/kickstart.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/kotlin.yaml +66 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/kvlang.yaml +67 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ledger.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lfe.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lilypond.yaml +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lisp.yaml +17 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/log.yaml +92 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/lua.yaml +111 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/mail.yaml +25 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/makefile.yaml +38 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/man.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/markdown.yaml +65 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/mc.yaml +23 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/meson.yaml +51 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/micro.yaml +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/mpdconf.yaml +13 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/msbuild.yaml +6 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nanorc.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nftables.yaml +30 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nginx.yaml +22 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nim.yaml +27 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nix.yaml +32 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/nu.yaml +114 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/objc.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ocaml.yaml +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/octave.yaml +83 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/odin.yaml +64 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pascal.yaml +45 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/patch.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/peg.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/perl.yaml +58 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/php.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pkg-config.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/po.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pony.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/pov.yaml +21 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/privoxy-action.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/privoxy-config.yaml +10 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/privoxy-filter.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/proto.yaml +40 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/prql.yaml +84 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/puppet.yaml +22 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/python2.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/python3.yaml +80 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/r.yaml +32 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/raku.yaml +42 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/reST.yaml +18 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/renpy.yaml +15 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/rpmspec.yaml +43 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/ruby.yaml +73 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/rust.yaml +78 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sage.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/scad.yaml +53 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/scala.yaml +33 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sed.yaml +13 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sh.yaml +69 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sls.yaml +15 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/smalltalk.yaml +55 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/solidity.yaml +41 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/sql.yaml +35 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/stata.yaml +67 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/svelte.yaml +27 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/swift.yaml +103 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/systemd.yaml +16 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/tcl.yaml +18 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/terraform.yaml +87 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/tex.yaml +32 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/toml.yaml +56 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/twig.yaml +55 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/typescript.yaml +49 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/v.yaml +80 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vala.yaml +26 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/verilog.yaml +60 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vhdl.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vi.yaml +31 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/vue.yaml +64 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/xml.yaml +37 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/xresources.yaml +14 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/yaml.yaml +34 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/yum.yaml +12 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/zig.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/zscript.yaml +72 -0
- package/initramfs/buninu/apps/jsmdcui/runtime/syntax/zsh.yaml +52 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/README.md +396 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/assetsHelper.js +371 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/assetsLoader.mjs +85 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/assetsPacker.js +218 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/compiled.js +498 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/entry.mjs +17 -0
- package/initramfs/buninu/apps/jsmdcui/single-exe/packAssets.sh +7 -0
- package/initramfs/buninu/apps/jsmdcui/src/MDCUI_DEFAULT_EDIT +0 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/backup.js +165 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/buffer.js +126 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/fixed3-codec.js +140 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/loc.js +38 -0
- package/initramfs/buninu/apps/jsmdcui/src/buffer/message.js +29 -0
- package/initramfs/buninu/apps/jsmdcui/src/build-args.js +40 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/clean.js +172 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/colorscheme.js +99 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/config.js +125 -0
- package/initramfs/buninu/apps/jsmdcui/src/config/defaults.js +109 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/fence-events.mjs +144 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/heading-ids.mjs +1568 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/id-collision.mjs +111 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/identity.mjs +26 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/kitty-debug.mjs +25 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/kitty-images.mjs +280 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/kitty-mode.mjs +6 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/rerender-queue.mjs +66 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/rpc.mjs +1554 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/server.mjs +128 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/table-render.mjs +286 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/table-row-edit.mjs +226 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/task-checkbox.mjs +60 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/template-components.mjs +253 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/text-block-resize.mjs +177 -0
- package/initramfs/buninu/apps/jsmdcui/src/cui/tui-links.mjs +560 -0
- package/initramfs/buninu/apps/jsmdcui/src/display/ansi-style.js +60 -0
- package/initramfs/buninu/apps/jsmdcui/src/highlight/highlighter.js +243 -0
- package/initramfs/buninu/apps/jsmdcui/src/highlight/parser.js +225 -0
- package/initramfs/buninu/apps/jsmdcui/src/index.js +9586 -0
- package/initramfs/buninu/apps/jsmdcui/src/lua/engine.js +68 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/archive.js +50 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/clipboard.js +278 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/commands.js +221 -0
- package/initramfs/buninu/apps/jsmdcui/src/platform/terminal.js +5 -0
- package/initramfs/buninu/apps/jsmdcui/src/plugins/js-bridge.js +3377 -0
- package/initramfs/buninu/apps/jsmdcui/src/plugins/manager.js +674 -0
- package/initramfs/buninu/apps/jsmdcui/src/runtime/encodings.js +10 -0
- package/initramfs/buninu/apps/jsmdcui/src/runtime/registry.js +134 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/cell-buffer.js +81 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/events.js +263 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/screen.js +249 -0
- package/initramfs/buninu/apps/jsmdcui/src/screen/vt100.js +571 -0
- package/initramfs/buninu/apps/jsmdcui/src/shell/shell.js +70 -0
- package/initramfs/buninu/apps/jsmdcui/testapp.md +78 -0
- package/initramfs/buninu/apps/jsmdcui/tests/assets-helper.test.js +150 -0
- package/initramfs/buninu/apps/jsmdcui/tests/backup.test.js +158 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cat-markdown.test.js +139 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cdp-security.test.js +32 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cdp-websocket-test.html +46 -0
- package/initramfs/buninu/apps/jsmdcui/tests/cmphex3b64.js +95 -0
- package/initramfs/buninu/apps/jsmdcui/tests/compiled-runtime.test.js +139 -0
- package/initramfs/buninu/apps/jsmdcui/tests/config-settings.test.js +52 -0
- package/initramfs/buninu/apps/jsmdcui/tests/demo.test.js +448 -0
- package/initramfs/buninu/apps/jsmdcui/tests/docs-sync.test.js +14 -0
- package/initramfs/buninu/apps/jsmdcui/tests/fence-events.test.js +1293 -0
- package/initramfs/buninu/apps/jsmdcui/tests/heading-ids.test.js +559 -0
- package/initramfs/buninu/apps/jsmdcui/tests/heading-list-selector.test.js +2393 -0
- package/initramfs/buninu/apps/jsmdcui/tests/id-collision.test.js +514 -0
- package/initramfs/buninu/apps/jsmdcui/tests/jmigt.js +16 -0
- package/initramfs/buninu/apps/jsmdcui/tests/js-plugin-prompts.test.js +110 -0
- package/initramfs/buninu/apps/jsmdcui/tests/key-event.md +10 -0
- package/initramfs/buninu/apps/jsmdcui/tests/kitty-demo.md +184 -0
- package/initramfs/buninu/apps/jsmdcui/tests/kitty-images.test.js +288 -0
- package/initramfs/buninu/apps/jsmdcui/tests/kitty-mode.test.js +14 -0
- package/initramfs/buninu/apps/jsmdcui/tests/platform-commands.test.js +18 -0
- package/initramfs/buninu/apps/jsmdcui/tests/platform-terminal.test.js +8 -0
- package/initramfs/buninu/apps/jsmdcui/tests/pty-demo.js +492 -0
- package/initramfs/buninu/apps/jsmdcui/tests/rerender-queue.test.js +130 -0
- package/initramfs/buninu/apps/jsmdcui/tests/table-render.test.js +150 -0
- package/initramfs/buninu/apps/jsmdcui/tests/table-row-edit.test.js +138 -0
- package/initramfs/buninu/apps/jsmdcui/tests/task-checkbox.test.js +33 -0
- package/initramfs/buninu/apps/jsmdcui/tests/template-components.test.js +422 -0
- package/initramfs/buninu/apps/jsmdcui/tests/text-block-resize.test.js +222 -0
- package/initramfs/buninu/apps/jsmdcui/tests/textarea.md +8 -0
- package/initramfs/buninu/apps/jsmdcui/tests/tui-links.test.js +298 -0
- package/initramfs/buninu/apps/jsmdcui/tests/wui-responsive-images.test.js +60 -0
- package/initramfs/buninu/apps/jsmdcui/tests/wui.test.js +108 -0
- package/initramfs/buninu/apps/jsmdcui/tests/wv-client.js +96 -0
- package/initramfs/buninu/apps/jsmdcui/tui +7 -0
- package/initramfs/buninu/apps/jsmdcui/wui +9 -0
- package/initramfs/buninu/apps/musl-la/LICENSES/GPL-3.0.txt +674 -0
- package/initramfs/buninu/apps/musl-la/LICENSES/gcc_runtime_exception.txt +73 -0
- package/initramfs/buninu/apps/musl-la/LICENSE_musl.txt +193 -0
- package/initramfs/buninu/apps/musl-la/NOTICE +41 -0
- package/initramfs/buninu/apps/musl-la/ld-musl-aarch64.so.1 +0 -0
- package/initramfs/buninu/apps/musl-la/libgcc_s.so.1 +0 -0
- package/initramfs/buninu/apps/musl-la/libstdc++.so.6 +0 -0
- package/initramfs/buninu/apps/musl-la/musl-la.sh +36 -0
- package/initramfs/buninu/apps/native-bridge/native-bridge.js +199 -0
- package/initramfs/buninu/apps/native-bridge/package.json +8 -0
- package/initramfs/buninu/apps/tts/tts.js +214 -0
- package/initramfs/buninu/apps/xclip/xclip.js +121 -0
- package/initramfs/buninu/apps/xdg-open/xdg-open.js +151 -0
- package/initramfs/buninu/bin/bun.bat +37 -0
- package/initramfs/buninu/bin/bun.sh +57 -0
- package/initramfs/buninu/bin/buninu-help.bat +4 -0
- package/initramfs/buninu/bin/buninu-help.sh +7 -0
- package/initramfs/buninu/bin/bunmsh.bat +3 -0
- package/initramfs/buninu/bin/bunmsh.sh +5 -0
- package/initramfs/buninu/bin/bunx.bat +3 -0
- package/initramfs/buninu/bin/glow.bat +3 -0
- package/initramfs/buninu/bin/glow.sh +5 -0
- package/initramfs/buninu/bin/init.js +779 -0
- package/initramfs/buninu/bin/install.js +570 -0
- package/initramfs/buninu/bin/jmi.bat +3 -0
- package/initramfs/buninu/bin/jmi.sh +5 -0
- package/initramfs/buninu/bin/jsgotty.bat +3 -0
- package/initramfs/buninu/bin/jsgotty.sh +5 -0
- package/initramfs/buninu/bin/jsmdcui.bat +11 -0
- package/initramfs/buninu/bin/libsh-loader.c +135 -0
- package/initramfs/buninu/bin/libsh-loader.so +0 -0
- package/initramfs/buninu/bin/multicall.sh +103 -0
- package/initramfs/buninu/bin/native-bridge.bat +3 -0
- package/initramfs/buninu/bin/rz.bat +3 -0
- package/initramfs/buninu/bin/rz.sh +5 -0
- package/initramfs/buninu/bin/shc.js +5 -0
- package/initramfs/buninu/bin/showimg.bat +3 -0
- package/initramfs/buninu/bin/showimg.sh +5 -0
- package/initramfs/buninu/bin/switch_to_android.sh +9 -0
- package/initramfs/buninu/bin/switch_to_linux.sh +7 -0
- package/initramfs/buninu/bin/sz.bat +3 -0
- package/initramfs/buninu/bin/sz.sh +5 -0
- package/initramfs/buninu/bin/tts.bat +3 -0
- package/initramfs/buninu/bin/xclip.bat +3 -0
- package/initramfs/buninu/bin/xdg-open.bat +3 -0
- package/initramfs/buninu/demo-server.js +64 -0
- package/initramfs/buninu/icon.png +0 -0
- package/initramfs/buninu/package.json +59 -0
- package/initramfs/etc/resolv.conf +1 -0
- package/initramfs/init.js +339 -0
- package/initramfs/lib/ld-musl-x86_64.so.1 +0 -0
- package/initramfs/lib/libc.musl-x86_64.so.1 +0 -0
- package/initramfs/lib/libgcc_s.so.1 +0 -0
- package/initramfs/lib/libstdc++.so.6 +0 -0
- package/initramfs/usr/bin/env +7 -0
- package/package.json +42 -0
- package/run-qemu.sh +44 -0
- package/scripts/fetch.sh +26 -0
- package/scripts/pack-initramfs.sh +41 -0
- package/test/build-init-bootstrap.sh +23 -0
- package/test/init-bootstrap.c +55 -0
|
@@ -0,0 +1,1042 @@
|
|
|
1
|
+
# bunmsh
|
|
2
|
+
|
|
3
|
+
- `bunmsh` is a dependency-free, mksh-inspired cross-platform command shell for Bun JavaScript
|
|
4
|
+
* Bun Modern Shell
|
|
5
|
+
- Early releases focus on a small, usable command interpreter rather than full mksh compatibility.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Install Bun first
|
|
10
|
+
|
|
11
|
+
- bunmsh requires [Bun](https://bun.com)
|
|
12
|
+
- On Android, install it in Termux:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install -g bun
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
On other platforms, follow the
|
|
19
|
+
[official Bun installation guide](https://bun.com/docs/installation).
|
|
20
|
+
|
|
21
|
+
No project dependencies need to be installed with `npm install` or `bun install`.
|
|
22
|
+
|
|
23
|
+
#### Prompt note for frequent SSH users
|
|
24
|
+
|
|
25
|
+
- By default bunmsh prompts don't show user@host
|
|
26
|
+
- Show them by a custom `PS1`:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
PS1=$(printf "$(id -un)@$(hostname):\\w\n%s" '$ ') npx bunmsh
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Option 1: Run with npx
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
# Interactive shell
|
|
36
|
+
npx bunmsh
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npx bunmsh -c 'print $PATH'
|
|
41
|
+
|
|
42
|
+
# Call cmd; this can call bunmsh builtins too
|
|
43
|
+
npx bunmsh -cc echo 'hello world' '*.txt' '$HOME'
|
|
44
|
+
|
|
45
|
+
npx bunmsh script.sh argv1 argv2
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`-cc` means **call cmd**. Every argument after it is forwarded as an
|
|
49
|
+
already-quoted word, without another round of bunmsh parsing or expansion. The
|
|
50
|
+
example calls the `echo` builtin and prints `hello world *.txt $HOME` literally.
|
|
51
|
+
|
|
52
|
+
`npx` installs and launches the package, but the `bunmsh` executable itself
|
|
53
|
+
uses Bun. Bun must therefore already be available on `PATH`.
|
|
54
|
+
|
|
55
|
+
### Option 2: Run with git clone
|
|
56
|
+
|
|
57
|
+
- Interactive shell
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
git clone https://github.com/jjtseng93/bunmsh.git
|
|
61
|
+
cd bunmsh
|
|
62
|
+
|
|
63
|
+
bun ./bunmsh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- Running commands or scripts
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
bun ./bunmsh -c 'print $PATH'
|
|
70
|
+
|
|
71
|
+
# Call cmd; this can call bunmsh builtins too
|
|
72
|
+
bun ./bunmsh -cc echo 'hello world' '*.txt' '$HOME'
|
|
73
|
+
|
|
74
|
+
bun ./bunmsh script.sh argv1 argv2
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`-cc` means **call cmd**. Every argument after it is forwarded as an
|
|
78
|
+
already-quoted word, without another round of bunmsh parsing or expansion. The
|
|
79
|
+
example calls the `echo` builtin and prints `hello world *.txt $HOME` literally.
|
|
80
|
+
|
|
81
|
+
### Useful CLI options
|
|
82
|
+
|
|
83
|
+
| Option | Effect |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `-c SCRIPT_TEXT [argv...]` | Treat command text as a shell script, then parse and execute it |
|
|
86
|
+
| `-cc COMMAND [argv...]` | Call a command with argv as-is; no shell parsing or shell expansions |
|
|
87
|
+
| `-i` | Enter interactive mode, including after running a script |
|
|
88
|
+
| `--mouse` | Start with terminal mouse tracking enabled |
|
|
89
|
+
| `--builtin-only` | Skip direct command-name lookup through `PATH` |
|
|
90
|
+
|
|
91
|
+
`-c` treats its command text as a shell script and performs the normal parse
|
|
92
|
+
and execute flow. Arguments after the script text become its argv array:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
bunmsh -c 'echo "$0" "$1"' Hello world
|
|
96
|
+
# Hello world
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`-cc` means **Call Command**. It can call an alias, builtin, or command from
|
|
100
|
+
`PATH`. Every following argument is passed as-is, without shell parsing or
|
|
101
|
+
shell expansions:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
bunmsh -cc echo '$HOME' '*.js'
|
|
105
|
+
# $HOME *.js
|
|
106
|
+
|
|
107
|
+
bunmsh -cc lsfancy -lh
|
|
108
|
+
# List cwd with emojis
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
In other words, the argv following `-cc` is already quoted. Metacharacters,
|
|
112
|
+
variables, and glob patterns remain literal instead of being interpreted by
|
|
113
|
+
bunmsh.
|
|
114
|
+
|
|
115
|
+
Mouse tracking can alternatively be enabled with `BUNMSH_MOUSE=1`; `true`,
|
|
116
|
+
`on`, and `yes` are also accepted case-insensitively. It is opt-in because
|
|
117
|
+
application mouse tracking prevents normal scrollback gestures in terminals
|
|
118
|
+
such as Termux and xterm.
|
|
119
|
+
|
|
120
|
+
In `--builtin-only` mode, regular and fallback builtins, aliases, and functions
|
|
121
|
+
remain available. An explicit executable path containing `/` can still run.
|
|
122
|
+
The `which` builtin always searches the current `PATH`, so `"$(which COMMAND)"`
|
|
123
|
+
can explicitly select a PATH executable while this mode is active. Use
|
|
124
|
+
`tab path` interactively to toggle this setting; `tab path on`/`true` enables
|
|
125
|
+
direct PATH lookup and `tab path off`/`false` disables it.
|
|
126
|
+
|
|
127
|
+
### Highest-priority JavaScript mode
|
|
128
|
+
|
|
129
|
+
```console
|
|
130
|
+
# Read a Bun value; non-undefined results are printed automatically
|
|
131
|
+
📁 ~/bunmsh
|
|
132
|
+
$ Bun.version
|
|
133
|
+
|
|
134
|
+
# Promises are awaited automatically
|
|
135
|
+
📁 ~/bunmsh
|
|
136
|
+
$ Bun.file("package.json").text()
|
|
137
|
+
📁 ~/bunmsh
|
|
138
|
+
$ Bun.sleep(500).then(() => "finished")
|
|
139
|
+
|
|
140
|
+
# Run arbitrary JavaScript statements or an expression
|
|
141
|
+
📁 ~/bunmsh
|
|
142
|
+
$ Bun.e; const numbers = [1, 2, 3]; numbers.reduce((a, b) => a + b, 0)
|
|
143
|
+
6
|
|
144
|
+
📁 ~/bunmsh
|
|
145
|
+
$ Bun.e, ({ cwd: process.cwd(), pid: process.pid })
|
|
146
|
+
|
|
147
|
+
# Share a value across later commands and cwd tabs in this bunmsh process
|
|
148
|
+
📁 ~/bunmsh
|
|
149
|
+
$ Bun.sha.var_name = { value: 123 }
|
|
150
|
+
{ value: 123 }
|
|
151
|
+
📁 ~/bunmsh
|
|
152
|
+
$ Bun.sha.var_name.value
|
|
153
|
+
123
|
|
154
|
+
|
|
155
|
+
# JavaScript inside ordinary shell command substitution
|
|
156
|
+
📁 ~/bunmsh
|
|
157
|
+
$ echo "Bun version: $(Bun.version)"
|
|
158
|
+
|
|
159
|
+
# Feed a JavaScript result into ordinary shell flow control
|
|
160
|
+
📁 ~/bunmsh
|
|
161
|
+
$ if [ $(Bun.e, Math.PI<3 ) = true ] ; then echo right ; else echo wrong ; fi
|
|
162
|
+
wrong
|
|
163
|
+
📁 ~/bunmsh
|
|
164
|
+
$ if [ $(Bun.e, Math.PI>3 ) = true ] ; then echo right ; else echo wrong ; fi
|
|
165
|
+
right
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
bunmsh can evaluate Bun JavaScript directly. Before tokenising, quoting, or
|
|
169
|
+
performing any shell expansion, it removes leading whitespace and checks the
|
|
170
|
+
first four characters of the original input. If they are exactly `Bun.`, the
|
|
171
|
+
entire input is passed directly to JavaScript `eval` instead of the shell
|
|
172
|
+
parser. Everything else continues through the normal shell parser.
|
|
173
|
+
|
|
174
|
+
A non-`undefined` result is printed automatically. Promises are awaited, so
|
|
175
|
+
asynchronous Bun APIs do not need explicit top-level `await`. Errors are
|
|
176
|
+
printed to standard error with a stack trace and set the shell status to `1`;
|
|
177
|
+
successful evaluation sets it to `0`, and an `undefined` result prints nothing.
|
|
178
|
+
|
|
179
|
+
#### Use `Bun.e;` or `Bun.e,` to run arbitrary JavaScript
|
|
180
|
+
|
|
181
|
+
The `Bun.` prefix is only the switch that selects JavaScript mode; the code
|
|
182
|
+
does not otherwise have to call a Bun API. `Bun.e` is a convenient no-op prefix
|
|
183
|
+
that permits arbitrary JavaScript while keeping the required first four
|
|
184
|
+
characters. The `e` property does not need to exist because reading a missing
|
|
185
|
+
JavaScript property simply produces `undefined`.
|
|
186
|
+
|
|
187
|
+
Technically, any property name works because only the leading `Bun.` is
|
|
188
|
+
checked; for example, `Bun.x;` and `Bun.anything,` also enter JavaScript mode.
|
|
189
|
+
This README uses `e` conventionally because it stands for **eval** (or
|
|
190
|
+
**evaluate**), is short, and makes the intent recognisable. Use `Bun.e;` before
|
|
191
|
+
one or more statements and `Bun.e,` before a single expression.
|
|
192
|
+
|
|
193
|
+
`Bun.e;` discards the `Bun.e` value and starts a new statement. `Bun.e,`
|
|
194
|
+
discards it through JavaScript's comma operator and returns the expression on
|
|
195
|
+
the right. Neither form invokes Bun Shell by itself; their purpose here is
|
|
196
|
+
only to enter the highest-priority evaluator and then execute unrestricted
|
|
197
|
+
JavaScript.
|
|
198
|
+
|
|
199
|
+
#### Use `$` to read and write shell variables
|
|
200
|
+
|
|
201
|
+
Inside JavaScript mode, `$` is the shell's own variable table — the live
|
|
202
|
+
object, not a copy — so the two languages share one set of variables instead of
|
|
203
|
+
passing strings between them:
|
|
204
|
+
|
|
205
|
+
```sh
|
|
206
|
+
Bun.e, $.HOME # read
|
|
207
|
+
Bun.e, $.PATH.split(":").length # read, as a JavaScript value
|
|
208
|
+
Bun.e; void ($.TAG = "v" + Date.now())
|
|
209
|
+
echo "$TAG" # the shell sees what JavaScript wrote
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
A shell variable is visible to JavaScript whether or not it was exported, and a
|
|
213
|
+
name JavaScript writes behaves like any other shell variable from that point
|
|
214
|
+
on, including being inherited by external child processes. `delete $.NAME`
|
|
215
|
+
unsets one, and `Object.keys($)` enumerates them.
|
|
216
|
+
|
|
217
|
+
An assignment is an expression, so its value is printed like any other result.
|
|
218
|
+
Wrap it in `void (...)` — as above — when the assignment is the point and the
|
|
219
|
+
echo is not.
|
|
220
|
+
|
|
221
|
+
**Everything the shell put there is a string.** A shell has no other type, so
|
|
222
|
+
`+` concatenates where you may have meant arithmetic — convert first:
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
X=3
|
|
226
|
+
Bun.e, $.X + 1 # "31"
|
|
227
|
+
Bun.e, Number($.X) + 1 # 4
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
The reverse direction does not convert for you either: `$.N = 42` stores the
|
|
231
|
+
number 42 in the table. The shell and any child process still read `42`,
|
|
232
|
+
because they stringify at their own boundary, but JavaScript now sees a number
|
|
233
|
+
under that name and a string under every name the shell set — so the same
|
|
234
|
+
expression means two different things depending on who last wrote the variable:
|
|
235
|
+
|
|
236
|
+
```sh
|
|
237
|
+
X=3
|
|
238
|
+
Bun.e; void ($.N = 42)
|
|
239
|
+
Bun.e, [$.X + 1, $.N + 1] # [ "31", 43 ]
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Assign strings (`$.N = String(count)`) to keep one rule for every name.
|
|
243
|
+
|
|
244
|
+
Two things to know:
|
|
245
|
+
|
|
246
|
+
- `$` is bound only inside JavaScript mode, and only shadows the bare name.
|
|
247
|
+
`Bun.$`, Bun Shell's own API, is reached through the `Bun` object and is
|
|
248
|
+
unaffected.
|
|
249
|
+
- Writing through `$` mutates the table directly, so it bypasses `readonly`.
|
|
250
|
+
`readonly R=locked` still refuses `R=other` from the shell, but
|
|
251
|
+
`$.R = "other"` goes through. That makes it an escape hatch, and a way to
|
|
252
|
+
break an invariant the shell was asked to hold.
|
|
253
|
+
|
|
254
|
+
#### One line at a time
|
|
255
|
+
|
|
256
|
+
JavaScript mode runs the line it was given. It does not continue across lines
|
|
257
|
+
the way a shell command does, because the shell's continuation marker is not
|
|
258
|
+
JavaScript: a bare `\` at the end of a line is a syntax error there, not a
|
|
259
|
+
request for another line, so the prompt does not ask for one.
|
|
260
|
+
|
|
261
|
+
The exception is the place where JavaScript has a line continuation of its
|
|
262
|
+
own — inside a string or template literal — and there it works, because the
|
|
263
|
+
prompt keeps collecting lines while the quote is open and JavaScript joins them
|
|
264
|
+
itself:
|
|
265
|
+
|
|
266
|
+
```sh
|
|
267
|
+
Bun.e, "abc\
|
|
268
|
+
def"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
```text
|
|
272
|
+
abcdef
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
An unbalanced bracket does not continue: the shell's parser is looking for
|
|
276
|
+
shell syntax, not JavaScript's, so `Bun.e; function f() {` runs as typed and
|
|
277
|
+
reports its own syntax error. For code that spans lines, put it in a file and
|
|
278
|
+
`import` it, or keep the statements on one line separated by `;`.
|
|
279
|
+
|
|
280
|
+
#### Use `Bun.sha` as a shared area (hack)
|
|
281
|
+
|
|
282
|
+
`Bun.sha` is normally Bun's SHA hashing function. JavaScript functions are
|
|
283
|
+
objects, and the function is extensible in current Bun versions, so properties
|
|
284
|
+
such as `Bun.sha.var_name` can serve as a lightweight process-wide shared area.
|
|
285
|
+
|
|
286
|
+
These lines already begin with `Bun.`, so they enter the highest-priority
|
|
287
|
+
JavaScript evaluator directly. Values remain available to later commands,
|
|
288
|
+
tabs and command substitutions running in the same bunmsh process. They do
|
|
289
|
+
not survive a bunmsh restart and are not inherited as JavaScript objects by
|
|
290
|
+
external child processes.
|
|
291
|
+
|
|
292
|
+
This is deliberately a hack, not an official Bun storage API. Use fresh
|
|
293
|
+
property names. A function already has reserved or behaviour-sensitive names
|
|
294
|
+
such as `name`, `length`, `call`, `apply`, `bind`, `caller`, `arguments`,
|
|
295
|
+
`constructor` and `toString`. In the tested Bun version, `name` and `length`
|
|
296
|
+
are read-only and assignment throws a `TypeError`; shadowing other Function
|
|
297
|
+
properties can break normal function behaviour. Before choosing a direct
|
|
298
|
+
property name, check it with `Bun.e, Object.hasOwn(Bun.sha, "var_name")`.
|
|
299
|
+
|
|
300
|
+
#### JavaScript inside shell command substitution
|
|
301
|
+
|
|
302
|
+
This mode also composes with shell command substitution. The outer command is
|
|
303
|
+
parsed as shell, while the contents of `$(...)` are evaluated again and can
|
|
304
|
+
trigger JavaScript mode independently.
|
|
305
|
+
|
|
306
|
+
#### Flow control with JavaScript values
|
|
307
|
+
|
|
308
|
+
JavaScript command substitution can feed ordinary shell tests and flow
|
|
309
|
+
control. The outer `if`, `[`, `then`, `else`, and `fi` remain shell syntax;
|
|
310
|
+
only the contents of each `$(...)` enter the JavaScript evaluator.
|
|
311
|
+
|
|
312
|
+
> **Security:** this is unrestricted JavaScript execution with the same file,
|
|
313
|
+
> process, environment and network permissions as bunmsh. Never pass untrusted
|
|
314
|
+
> input to this mode or expose it as a remote command interface.
|
|
315
|
+
|
|
316
|
+
### History
|
|
317
|
+
|
|
318
|
+
Interactive bunmsh loads its own saved history and imports both Bash and Fish
|
|
319
|
+
history once at startup. Imported commands immediately participate in
|
|
320
|
+
history-based ghost completion, but the Bash and Fish source files are
|
|
321
|
+
read-only and are never modified by bunmsh:
|
|
322
|
+
|
|
323
|
+
```text
|
|
324
|
+
~/.bash_history
|
|
325
|
+
~/.local/share/fish/fish_history
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Fish history uses Fish's documented YAML-style records; it is not treated as
|
|
329
|
+
standards-compliant YAML. Empty entries, Bash timestamp records and duplicate
|
|
330
|
+
commands are removed while keeping the most recent occurrence.
|
|
331
|
+
`BUNMSH_IMPORT_HISTORY` controls only the Bash and Fish imports; saved bunmsh
|
|
332
|
+
history is still loaded. Set it to disable external startup imports:
|
|
333
|
+
|
|
334
|
+
```sh
|
|
335
|
+
BUNMSH_IMPORT_HISTORY=0 bunmsh
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
`false`, `off` and `no` are also accepted, case-insensitively.
|
|
339
|
+
|
|
340
|
+
bunmsh saves its own history to a file, loaded again by every newly opened
|
|
341
|
+
bunmsh for both Up/Down arrow recall and ghost completion.
|
|
342
|
+
|
|
343
|
+
- **When it saves.** Automatically: every 60 seconds, once more when the
|
|
344
|
+
shell exits, and once more if it receives SIGTERM or SIGHUP (for example
|
|
345
|
+
from `kill`, or a terminal emulator closing its window) — while a
|
|
346
|
+
foreground command owns the terminal, a caught SIGTERM/SIGHUP flushes
|
|
347
|
+
history immediately but does not stop that command, since bunmsh has no
|
|
348
|
+
job-control layer yet that could do so safely; the shell exits once the
|
|
349
|
+
command finishes on its own. `tab s`/`tab save` trigger the same save on
|
|
350
|
+
demand, e.g. right before closing the terminal some other way.
|
|
351
|
+
- **File format.** [JSON Lines](https://jsonlines.org/) — one JSON-encoded
|
|
352
|
+
command per line. A history file saved in bunmsh's older single-JSON-array
|
|
353
|
+
format is still read correctly and is silently upgraded to JSON Lines the
|
|
354
|
+
next time anything is saved.
|
|
355
|
+
- **How concurrent sessions are handled.** Every save above only *appends*
|
|
356
|
+
the lines this session hasn't saved yet — it never rewrites the file. That
|
|
357
|
+
makes it safe to run several bunmsh sessions at once: each one only adds
|
|
358
|
+
its own new lines to the end and never touches (or needs to know about)
|
|
359
|
+
what another session has written, so two sessions saving around the same
|
|
360
|
+
time can't overwrite each other's history the way rewriting the whole file
|
|
361
|
+
each time would risk.
|
|
362
|
+
- **Deduplication.** Because saving only appends, duplicate commands are
|
|
363
|
+
*not* removed automatically. Run `tab s d` (or `tab save dedupe`) to
|
|
364
|
+
rewrite the file keeping only each command's most recent occurrence.
|
|
365
|
+
Unlike the routine append, that rewrites the whole file, so it is an
|
|
366
|
+
explicit, occasional choice that carries a small chance of losing another
|
|
367
|
+
session's write if it happens mid-rewrite — the command's own output says
|
|
368
|
+
so if it looks like that happened, so it's obvious when it's worth
|
|
369
|
+
rerunning.
|
|
370
|
+
- **File location.** `$XDG_DATA_HOME/bunmsh/history`, falling back to
|
|
371
|
+
`~/.local/share/bunmsh/history`. Windows uses
|
|
372
|
+
`%LOCALAPPDATA%/bunmsh/history`.
|
|
373
|
+
|
|
374
|
+
### Tab system
|
|
375
|
+
|
|
376
|
+
| Command | Effect |
|
|
377
|
+
| --- | --- |
|
|
378
|
+
| `tab` | Create a second tab when only one exists; otherwise cycle right |
|
|
379
|
+
| `tab n` | Create and activate a new tab at the current cwd |
|
|
380
|
+
| `tab NUMBER` | Activate a tab by its 1-based number |
|
|
381
|
+
| `tab l` | Cycle left |
|
|
382
|
+
| `tab r` | Cycle right |
|
|
383
|
+
| `tab x`, `tab c` | Close the active tab |
|
|
384
|
+
|
|
385
|
+
bunmsh includes lightweight cwd tabs and starts with one tab. A tab stores only
|
|
386
|
+
its working directory; variables, environment, aliases, readonly names,
|
|
387
|
+
positional arguments, command status, and other shell state remain shared.
|
|
388
|
+
Switching tabs changes `cwd` and updates `PWD` without changing `OLDPWD`.
|
|
389
|
+
|
|
390
|
+
When more than one tab exists, the prompt displays every remembered path:
|
|
391
|
+
|
|
392
|
+
```text
|
|
393
|
+
📁 ~/project 📂 ~/project/src
|
|
394
|
+
[2]$
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
`📂` marks the active tab and `📁` marks inactive tabs. The complete active
|
|
398
|
+
entry is highlighted in cyan-blue. The default prompt includes the active
|
|
399
|
+
tab's 1-based number only when multiple tabs exist.
|
|
400
|
+
|
|
401
|
+
Left and right movement wrap at the ends. Closing a tab selects the tab that
|
|
402
|
+
moves into the same position, or the previous tab when closing the rightmost
|
|
403
|
+
one. The final remaining tab cannot be closed.
|
|
404
|
+
|
|
405
|
+
A typical workflow is:
|
|
406
|
+
|
|
407
|
+
```sh
|
|
408
|
+
cd ~/project
|
|
409
|
+
tab n
|
|
410
|
+
cd src
|
|
411
|
+
tab l # back to ~/project
|
|
412
|
+
tab r # back to ~/project/src
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Special Interactions
|
|
416
|
+
|
|
417
|
+
### Completion and ghost suggestions
|
|
418
|
+
|
|
419
|
+
Tab completes the word being typed, and a dim **ghost** shows the first match
|
|
420
|
+
inline ahead of the cursor; the Right arrow accepts it. What is offered depends
|
|
421
|
+
on where the cursor is:
|
|
422
|
+
|
|
423
|
+
| Where | Offered |
|
|
424
|
+
| --- | --- |
|
|
425
|
+
| A command name | Builtins, aliases, and executables on `PATH` |
|
|
426
|
+
| Inside `$(` | Command names again — a substitution starts a new command |
|
|
427
|
+
| A `$` being typed | Shell variable names |
|
|
428
|
+
| A JavaScript line | `$.` completes a variable name, a string literal a path |
|
|
429
|
+
| Anywhere else | Files and directories, and history for the ghost |
|
|
430
|
+
|
|
431
|
+
**Variables.** `$HO` suggests `$HOME`, and `${HO` suggests `${HOME}` — the
|
|
432
|
+
brace it opened is closed for it. `${#HO` works the same way. Names come from
|
|
433
|
+
the shell's own variable table, so unexported names and anything JavaScript
|
|
434
|
+
mode wrote through `$` are offered alongside the environment.
|
|
435
|
+
|
|
436
|
+
The suggestion follows the shell's own rules about when a `$` expands:
|
|
437
|
+
|
|
438
|
+
- It works wherever an expansion would: mid-word, on the right of an
|
|
439
|
+
assignment (`X=$HO`), inside double quotes, and where a command name would
|
|
440
|
+
go (`$ED`).
|
|
441
|
+
- Single quotes suppress it, because nothing expands inside them.
|
|
442
|
+
- Nothing is offered for the other things a `$` can start, since none of them
|
|
443
|
+
is a name in progress: `$(` (a command substitution), `$?`, `$1`, `$$`
|
|
444
|
+
(already complete), and `\$` (a literal dollar sign — the backslashes are
|
|
445
|
+
counted, so `\\$HO` does suggest).
|
|
446
|
+
- A bare `$` has no name to match on, so it ghosts nothing. Tab still lists
|
|
447
|
+
every variable, the way Tab on an empty word lists every file.
|
|
448
|
+
|
|
449
|
+
Where both could apply, history wins the ghost: it completes the whole line,
|
|
450
|
+
which reaches further than a single variable name.
|
|
451
|
+
|
|
452
|
+
**On a JavaScript line** — one starting with `Bun.`, the same test the
|
|
453
|
+
evaluator dispatches on — the line is read as JavaScript instead, because shell
|
|
454
|
+
word-splitting says nothing useful about it. Two things complete there:
|
|
455
|
+
|
|
456
|
+
```sh
|
|
457
|
+
Bun.e, $.HO # -> $.HOME
|
|
458
|
+
Bun.e, Bun.file("/tm # -> a path, completed inside the string
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
- After `$.`, shell variable names. A bare `$` completes nothing here: in
|
|
462
|
+
JavaScript it is the variable table itself, and a name only begins after the
|
|
463
|
+
dot.
|
|
464
|
+
- Inside an unclosed string literal — `"`, `'`, or a template — the text back
|
|
465
|
+
to the opening quote is completed as a path. No trailing space is needed to
|
|
466
|
+
make the completer see it, and nothing has to be trimmed back off afterwards.
|
|
467
|
+
- A template's `${...}` is code again, so `$.` completes inside it and the
|
|
468
|
+
path resumes after the closing brace.
|
|
469
|
+
- Where neither applies, only the history ghost is offered; shell completion
|
|
470
|
+
would just produce noise on a JavaScript line.
|
|
471
|
+
|
|
472
|
+
### Keyboard shortcuts
|
|
473
|
+
|
|
474
|
+
- `Ctrl-C`: Interrupts the current input or foreground operation and returns to
|
|
475
|
+
a fresh prompt without exiting bunmsh.
|
|
476
|
+
|
|
477
|
+
- `Ctrl-D`: On an empty input line, sends EOF and exits the interactive shell.
|
|
478
|
+
|
|
479
|
+
- `Ctrl-T`: Calls `builtin tab` without adding a command to history. It creates
|
|
480
|
+
a tab when only one exists, or switches to the next tab otherwise. Any
|
|
481
|
+
command text currently being edited is preserved.
|
|
482
|
+
|
|
483
|
+
- `Alt-T`: Calls `builtin tab l` without adding a command to history, switching
|
|
484
|
+
to the tab on the left while preserving the command currently being edited.
|
|
485
|
+
|
|
486
|
+
- `Alt-L`: Calls `builtin lsfancy` without adding a command to history. It
|
|
487
|
+
immediately rereads and lists the active tab's cwd while preserving the
|
|
488
|
+
command currently being edited.
|
|
489
|
+
|
|
490
|
+
- `Alt-U` / `Alt-P`: Calls `builtin lsfancy ..` to list the Parent (upper)
|
|
491
|
+
folder without changing cwd, adding a command to history, or discarding the
|
|
492
|
+
command currently being edited.
|
|
493
|
+
|
|
494
|
+
- `Alt-C`: Calls `builtin tab x` to close the active tab without adding a
|
|
495
|
+
command to history. `tab c` is an equivalent command form.
|
|
496
|
+
|
|
497
|
+
### Mouse interactions
|
|
498
|
+
|
|
499
|
+
- Mouse tab click: With mouse tracking enabled, left-clicking a tab's icon or
|
|
500
|
+
path activates it. Spaces between tabs are not clickable. Wrapped tab paths
|
|
501
|
+
remain clickable.
|
|
502
|
+
|
|
503
|
+
- Mouse tracking control: `tab mouse` toggles tracking. `tab mouse on`/`true`
|
|
504
|
+
explicitly enables it, while `tab mouse off`/`false` disables it.
|
|
505
|
+
|
|
506
|
+
- Mouse tab double-click: Double-clicking the same tab within 400 ms activates
|
|
507
|
+
it and calls `builtin lsfancy`, immediately rereading the directory without
|
|
508
|
+
using the completion cache.
|
|
509
|
+
|
|
510
|
+
- Mouse prompt-number click: When multiple tabs exist, clicking the number at
|
|
511
|
+
the start of the `$` prompt calls `builtin tab n` to create and activate a
|
|
512
|
+
new tab.
|
|
513
|
+
|
|
514
|
+
- Mouse click-to-position: Clicking anywhere in the line currently being
|
|
515
|
+
typed moves the cursor there instead of leaving it at the end, the same as
|
|
516
|
+
clicking inside a text field. Clicking past the end of the typed text moves
|
|
517
|
+
the cursor to the end of the line rather than doing nothing.
|
|
518
|
+
|
|
519
|
+
- Mouse foreground behavior: Mouse reporting is disabled while a foreground
|
|
520
|
+
command owns the terminal, so full-screen editors and other TUI programs
|
|
521
|
+
receive their own mouse input. bunmsh restores it when the command returns.
|
|
522
|
+
|
|
523
|
+
### Terminal behavior
|
|
524
|
+
|
|
525
|
+
- `↩️`: When a command finishes without a trailing newline, bunmsh prints this
|
|
526
|
+
marker and then inserts a newline before drawing the next prompt. The marker
|
|
527
|
+
makes it clear where the program's exact output ended; it is not part of the
|
|
528
|
+
command's output. Commands that end their own output with a newline do not
|
|
529
|
+
show the marker.
|
|
530
|
+
|
|
531
|
+
### Very short aliases
|
|
532
|
+
|
|
533
|
+
- `?`: When the entire command is exactly this single character, prints the
|
|
534
|
+
previous exit status. It is equivalent to `echo $?` and prints `0` after a
|
|
535
|
+
successful command. After a command fails, only the `$` in the next prompt
|
|
536
|
+
is shown in red. For Fish users, the corresponding expression is
|
|
537
|
+
`echo $status` because Fish uses `$status` where POSIX-style shells use `$?`.
|
|
538
|
+
|
|
539
|
+
- `..`: As a standalone command, changes to the parent directory. Equivalent
|
|
540
|
+
to `cd ..`.
|
|
541
|
+
|
|
542
|
+
- `//`: As a standalone command, returns to the most recently visited child
|
|
543
|
+
directory below the current cwd. Equivalent to `cd //`.
|
|
544
|
+
|
|
545
|
+
- `~`: As a standalone command, changes to `$HOME`. Equivalent to `cd`.
|
|
546
|
+
|
|
547
|
+
- `-`: As a standalone command, changes to `$OLDPWD` and prints the selected
|
|
548
|
+
path. Equivalent to `cd -`.
|
|
549
|
+
|
|
550
|
+
## Built-in commands and supported flags
|
|
551
|
+
|
|
552
|
+
This section documents the options implemented by bunmsh itself. It is not a
|
|
553
|
+
claim of complete POSIX, mksh or GNU compatibility. Shell builtins are resolved
|
|
554
|
+
before `PATH`. Fallback builtins are used only when no executable with the same
|
|
555
|
+
name is found in `PATH`; use `builtin NAME ...` to select either kind explicitly.
|
|
556
|
+
|
|
557
|
+
Run `builtin` with no arguments to print the registered names at runtime.
|
|
558
|
+
|
|
559
|
+
### Shell builtins (before PATH)
|
|
560
|
+
|
|
561
|
+
| Command | Supported flags/forms |
|
|
562
|
+
| --- | --- |
|
|
563
|
+
| `:`, `true`, `false` | No flags |
|
|
564
|
+
| `command` | `-p`, `-v`, `-V`, `--` |
|
|
565
|
+
| `builtin`, `__builtin` | `--`; no operand lists all builtins (`builtin` only) |
|
|
566
|
+
| `whence` | `-p`, `-v`, `--` |
|
|
567
|
+
| `which` | `--` |
|
|
568
|
+
| `type` | Names only |
|
|
569
|
+
| `alias` | `alias`, `alias NAME`, `alias NAME=VALUE` |
|
|
570
|
+
| `unalias` | `-a`, `--` |
|
|
571
|
+
| `test`, `[` | `!`, `-n`, `-z`, `-e`, `-f`, `-d`, `-b`, `-c`, `-p`, `-S`, `-L`, `-h`, `-s`, `-r`, `-w`, `-x`; string `=`, `==`, `!=`; integer `-eq`, `-ne`, `-gt`, `-ge`, `-lt`, `-le`; file `-nt`, `-ot`, `-ef`; `-a`, `-o` |
|
|
572
|
+
| `echo` | `-n` |
|
|
573
|
+
| `print` | `-r`, `-R`, `-n`, `-l`, `-N`, `-u1`, `-u2`, `--` |
|
|
574
|
+
| `printf` | `%s`, `%d`, `%i`, `%%`, numeric field width and zero padding; basic backslash escapes |
|
|
575
|
+
| `read` | `-r`, `--`; defaults to `REPLY` when no name is given |
|
|
576
|
+
| `pwd` | No flags |
|
|
577
|
+
| `cd`, `chdir` | `cd`, `cd DIR`, `cd -`, `cd //` |
|
|
578
|
+
| `tab` | `n`, `x`, `c`, `l`, `r`, `s`, `save`, `mouse [on\|off\|true\|false]`, `path [on\|off\|true\|false]`, or a 1-based tab number |
|
|
579
|
+
| `-`, `~`, `..`, `//` | Directory-navigation shortcuts |
|
|
580
|
+
| `export` | `NAME`, `NAME=VALUE` |
|
|
581
|
+
| `unset` | `-v`, `--` |
|
|
582
|
+
| `readonly` | `-p`, `--`, `NAME`, `NAME=VALUE` |
|
|
583
|
+
| `env` | `-i`, `--ignore-environment`, `-u NAME`, `--unset NAME`, `--unset=NAME`, `--` |
|
|
584
|
+
| `exec` | Command and arguments; no command is a no-op |
|
|
585
|
+
| `exit` | Optional numeric status |
|
|
586
|
+
| `shift` | Optional non-negative count |
|
|
587
|
+
| `getopts` | `getopts OPTSTRING NAME [ARG ...]` |
|
|
588
|
+
| `eval` | Arguments are joined and evaluated as shell source |
|
|
589
|
+
| `.`, `source` | `FILE [ARG ...]` |
|
|
590
|
+
| `realpath` | One or more paths |
|
|
591
|
+
| `umask` | No operand to display, or an octal mask |
|
|
592
|
+
| `kill` | `-l`, `-SIGNAL`, `-NUMBER`; on Windows, where the runtime can only `TerminateProcess` a subset of signals and never reaches the children, a terminating signal is sent as `taskkill /PID PID /T /F` instead, while `-0` still probes through the runtime |
|
|
593
|
+
| `set` | No operand to list variables; `-- ARG ...` sets positional arguments |
|
|
594
|
+
| `time` | Command and arguments; reports `real` elapsed time in milliseconds, with each decimal magnitude group shown in a different color |
|
|
595
|
+
| `yes` | Optional output words; no flags |
|
|
596
|
+
|
|
597
|
+
### The `serve` command
|
|
598
|
+
|
|
599
|
+
`serve [--auto-open] [--minapk-webview] [--random-url] [directory]` starts a minimal HTTP file server; it is a PATH-fallback
|
|
600
|
+
builtin, so a `serve` executable found in `PATH` wins unless it is invoked as
|
|
601
|
+
`builtin serve ...`.
|
|
602
|
+
|
|
603
|
+
- Serves the current working directory, or the directory given as the only
|
|
604
|
+
argument. More than one argument is a usage error.
|
|
605
|
+
- `PORT` selects the port; it defaults to `3000`, and only that default falls
|
|
606
|
+
back to a free port chosen by the OS when it is taken — an explicit `PORT`
|
|
607
|
+
that is already in use is an error. The URL it settled on is printed on
|
|
608
|
+
startup.
|
|
609
|
+
- `--auto-open` opens the printed URL after startup: `xdg-open` on PATH wins
|
|
610
|
+
on any platform, otherwise `open` on macOS or `cmd /c start` on Windows.
|
|
611
|
+
`--auto-open=/path` opens that path relative to the served URL instead of
|
|
612
|
+
the root (resolved after any `--random-url` prefix, so the secret prefix
|
|
613
|
+
stays intact); the `o` stdin control opens the same target.
|
|
614
|
+
- `--minapk-webview` adds `MINAPK_WEBVIEW=1` to the opener's child process,
|
|
615
|
+
matching the npm `buninu` package's WebView-aware `xdg-open` behavior
|
|
616
|
+
(`--minapk-webview=N` passes a different digit string).
|
|
617
|
+
- `--random-url` places the server behind a URL-safe random prefix generated
|
|
618
|
+
from four Bun UUIDv7 values — at least 248 bits of guaranteed-random
|
|
619
|
+
entropy (each UUIDv7's 62-bit `rand_b` field; the 48-bit timestamp isn't
|
|
620
|
+
secret, and Bun's `rand_a` is a monotonic counter within the same
|
|
621
|
+
millisecond rather than independently random, so neither counts toward the
|
|
622
|
+
floor); a request without it gets `404`.
|
|
623
|
+
- All three default to off/not-passed, and `SERVE_AUTO_OPEN`,
|
|
624
|
+
`SERVE_MINAPK_WEBVIEW`, and `SERVE_RANDOM_URL` set their defaults instead
|
|
625
|
+
(`SERVE_AUTO_OPEN` can also be set to a `/`-led path, same as
|
|
626
|
+
`--auto-open=/path`). A CLI flag always overrides its environment default:
|
|
627
|
+
the bare flag forces it on, and `=off`/`=no`/`=false`/`=` (empty) forces it
|
|
628
|
+
off, even if the environment turned it on inline.
|
|
629
|
+
- While it runs it holds the foreground. On a TTY it also takes single-word
|
|
630
|
+
controls on stdin: `q`, `quit` or `exit` stops it, and `o` opens the URL the
|
|
631
|
+
same way `--auto-open` would. `Ctrl-C` and `SIGTERM` stop it too, exiting
|
|
632
|
+
`130` and `143` respectively; every other way out exits `0`.
|
|
633
|
+
- Directory pages list the entries by name, each with an emoji for its kind,
|
|
634
|
+
and hide dotfiles. Previewable files get a `🔍` link next to them: it renders
|
|
635
|
+
Markdown, and pretty-prints JSON, JSON5, JSONC, JSONL, YAML and TOML, plus
|
|
636
|
+
XML when the running Bun provides `Bun.XML.parse`.
|
|
637
|
+
- Files are served through a whole, unsliced `Bun.file()` response, so Bun's
|
|
638
|
+
own `Range` handling applies — `206` and `416` included. Files inside a
|
|
639
|
+
compiled binary are the exception: Bun answers those with the whole body and
|
|
640
|
+
a `200`, whatever `Range` asked for.
|
|
641
|
+
- Paths that would escape the served directory are rejected with `400`, and a
|
|
642
|
+
failing request cannot take the server down; it answers `500` and stays up.
|
|
643
|
+
- It does not have to be started from inside an interactive bunmsh. Any of the
|
|
644
|
+
non-interactive entry points reaches it, which is what makes it usable as a
|
|
645
|
+
one-liner from another shell, a script, or a service unit:
|
|
646
|
+
|
|
647
|
+
```sh
|
|
648
|
+
./bmsh -cc builtin serve ./public # argv as-is, no shell parsing
|
|
649
|
+
./bmsh -c 'builtin serve ./public' # shell text, expansions apply
|
|
650
|
+
bun ./src/main.js -cc builtin serve . # from a source checkout
|
|
651
|
+
npx bunmsh -cc builtin serve . # without installing anything
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
`-cc` forwards everything after it as argv, so the calling shell does the
|
|
655
|
+
quoting and bunmsh performs no expansion of its own. `builtin` is what pins
|
|
656
|
+
the choice to this implementation; drop it and a `serve` executable found in
|
|
657
|
+
`PATH` would win. The `q`/`o` controls still work whenever stdin is a TTY,
|
|
658
|
+
and `Ctrl-C` stops it either way.
|
|
659
|
+
|
|
660
|
+
#### Serving a folder packed into the executable
|
|
661
|
+
|
|
662
|
+
Want `--auto-open`, `--minapk-webview`, or `--random-url` baked into the
|
|
663
|
+
binary? See the next section.
|
|
664
|
+
|
|
665
|
+
- What this is for is handing a folder of files to someone, not hosting a site.
|
|
666
|
+
- That is why `serve` never answers a directory with its `index.html`:
|
|
667
|
+
- `/` is always the listing, so the folder stays browsable
|
|
668
|
+
- and every file — the index page included — is one click away.
|
|
669
|
+
|
|
670
|
+
- Two other tools do the site case properly
|
|
671
|
+
* `npx serve <dir>` sends `index.html` for any directory that has one and falls
|
|
672
|
+
back to a listing for any directory that does not.
|
|
673
|
+
* Bun 1.4's directory routes do it in-process, streaming with `sendfile` and handling `Content-Type`, `ETag`, `Last-Modified`, `304` and `Range`; a directory holding an `index.html` gets it, one without gets `404`:
|
|
674
|
+
|
|
675
|
+
```js
|
|
676
|
+
Bun.serve({ routes: { "/static/*": { dir: "./public" } } });
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
A compiled `bmsh` can serve a directory that lives *inside* the binary, so a
|
|
680
|
+
whole folder ships as one file and is browsed over HTTP wherever it lands.
|
|
681
|
+
Nothing needs to be checked out or configured — two commands do it:
|
|
682
|
+
|
|
683
|
+
```sh
|
|
684
|
+
npx bunmsh --build-exe --asset /absolute/path/to/mysite
|
|
685
|
+
./bmsh -cc builtin serve 'B:/~BUN/mysite'
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
On Windows the build appends `.exe` to the output name, so the same two lines
|
|
689
|
+
read:
|
|
690
|
+
|
|
691
|
+
```powershell
|
|
692
|
+
npx bunmsh --build-exe --asset C:\path\to\mysite
|
|
693
|
+
./bmsh.exe -cc builtin serve 'B:/~BUN/mysite'
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
PowerShell's single quotes are literal, exactly like the POSIX shell's, so the
|
|
697
|
+
argument itself is written the same way on both. `cmd.exe` has no single
|
|
698
|
+
quotes — it would hand them to the program as part of the path — so there the
|
|
699
|
+
line is `.\bmsh.exe -cc builtin serve "B:/~BUN/mysite"`.
|
|
700
|
+
|
|
701
|
+
- Everything after `--build-exe` is forwarded to `bun build`, which is how
|
|
702
|
+
`--asset` reaches the compile step. `--build-for <target>` takes the same
|
|
703
|
+
trailing flags, so a cross-compiled binary can carry the folder too.
|
|
704
|
+
- **The path has to be absolute.** The compile runs from the installed
|
|
705
|
+
package's own directory, wherever npm put it, so a relative path resolves
|
|
706
|
+
somewhere else entirely and the build fails. A trailing slash is harmless.
|
|
707
|
+
- `--asset` keeps only the **basename** of the folder, and that name becomes a
|
|
708
|
+
root inside the binary: `/absolute/path/to/mysite` is served as
|
|
709
|
+
`B:/~BUN/mysite`, or equivalently `/$bunfs/root/mysite`. `serve` accepts
|
|
710
|
+
either spelling on either platform and treats the `/root` part as optional,
|
|
711
|
+
so one argument works on Linux, macOS and Windows alike. Quote it: both the
|
|
712
|
+
POSIX shells and PowerShell would otherwise expand `$bunfs` to nothing.
|
|
713
|
+
- The folder is copied in whole, recursively, and `./bmsh` is written to the
|
|
714
|
+
current directory, along with the `bmsh.meta.json` and `bmsh.meta.md` build
|
|
715
|
+
reports. Only the executable is needed to run it; the two reports can be
|
|
716
|
+
deleted.
|
|
717
|
+
- Serving `'B:/~BUN'` instead browses the binary's whole virtual root, which
|
|
718
|
+
also holds the executable itself and bunmsh's own embedded assets.
|
|
719
|
+
- Only a compiled executable has that virtual filesystem. From a source
|
|
720
|
+
checkout the same folder is just a folder: `serve ./mysite`.
|
|
721
|
+
|
|
722
|
+
`--asset` hands the files to Bun directly and bypasses bunmsh's asset packing
|
|
723
|
+
system. That system is the other way to do this — the folder is declared in
|
|
724
|
+
`package.json` under `assets` and the build runs with `ASSETS_BUNFS=1` — and
|
|
725
|
+
what it buys is source-level access: `readAssetText` and `readAssetBytes`
|
|
726
|
+
answer the same key whether the file is embedded or still on disk, so the same
|
|
727
|
+
JavaScript runs from a checkout and from the binary. `--asset` alone gives no
|
|
728
|
+
such reader; the files exist only as paths inside the binary. See
|
|
729
|
+
[`single-exe/README.md`](single-exe/README.md) for that route and for the
|
|
730
|
+
trade-offs between its two back ends.
|
|
731
|
+
|
|
732
|
+
#### Baking in `--auto-open`, `--minapk-webview`, `--random-url`
|
|
733
|
+
|
|
734
|
+
`serve`'s three env vars (`SERVE_AUTO_OPEN`, `SERVE_MINAPK_WEBVIEW`,
|
|
735
|
+
`SERVE_RANDOM_URL`) are each read as a literal `process.env.NAME` expression,
|
|
736
|
+
so `bun build`'s `--define` can bake a default straight into the compiled
|
|
737
|
+
binary — combine it with `--asset` to ship a self-opening server for a
|
|
738
|
+
folder. `--define` normally needs a bare string quoted as JSON; this
|
|
739
|
+
limitation doesn't apply here, because this project does extra handling to
|
|
740
|
+
quote it for you (see below):
|
|
741
|
+
|
|
742
|
+
```sh
|
|
743
|
+
bun ./src/main.js --build-exe --asset /absolute/path/to/mysite \
|
|
744
|
+
--define process.env.SERVE_RANDOM_URL=on \
|
|
745
|
+
--define process.env.SERVE_AUTO_OPEN=/index.html \
|
|
746
|
+
--define process.env.SERVE_MINAPK_WEBVIEW=1
|
|
747
|
+
./bmsh -cc builtin serve 'B:/~BUN/mysite'
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
```text
|
|
751
|
+
Serving B:/~BUN/mysite
|
|
752
|
+
http://localhost:3000/AaBIdviNcACxwZF2x3VW0QAaBIdviNcAGsAviNI5B59A.../index.html
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
That starts `xdg-open` (or the platform fallback) on `/index.html` behind the
|
|
756
|
+
random prefix, with `MINAPK_WEBVIEW=1` on its environment — no flags needed
|
|
757
|
+
on the command line, and a plain `SERVE_AUTO_OPEN=/index.html` set at
|
|
758
|
+
*runtime* no longer does anything, since `--define` replaced the
|
|
759
|
+
`process.env.SERVE_AUTO_OPEN` expression in the compiled code with a literal
|
|
760
|
+
before it ever runs. The CLI flags (`--auto-open`, `--random-url`,
|
|
761
|
+
`--minapk-webview`, with their `=off`/`=no`/`=false` forms) still work
|
|
762
|
+
normally and override whatever was baked in.
|
|
763
|
+
|
|
764
|
+
The resulting `bmsh` is also directly packageable with
|
|
765
|
+
`npx @drxiaozhi/minapk` ([minapk](https://www.npmjs.com/package/@drxiaozhi/minapk))
|
|
766
|
+
as the `libmain.so` the APK runs on launch:
|
|
767
|
+
|
|
768
|
+
```sh
|
|
769
|
+
npx @drxiaozhi/minapk ./bmsh -c "libmain.so -cc builtin serve 'B:/~BUN/mysite'"
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
`-c` replaces minapk's default startup command outright — that default is
|
|
773
|
+
what auto-runs a packaged `libmain.so`, so once `-c` is used it has to call
|
|
774
|
+
`libmain.so` itself, exactly as above, or the packaged binary never starts.
|
|
775
|
+
The app itself holds two WebViews from launch: `0` is the console the shell
|
|
776
|
+
above runs in, `1` is a second one that starts blank. `--minapk-webview` (or
|
|
777
|
+
baked-in `SERVE_MINAPK_WEBVIEW`) is what tells the packaged `xdg-open` to
|
|
778
|
+
load the served page into WebView `1` and switch to it — that switch, not
|
|
779
|
+
anything automatic about the APK itself, is what turns "the app opened" into
|
|
780
|
+
"the app is now showing this folder's content." Combine it with
|
|
781
|
+
`--auto-open`/`SERVE_AUTO_OPEN` (baked in as shown above, or passed on the
|
|
782
|
+
`serve` command line) so that switch happens on its own, no browser tab, no
|
|
783
|
+
separate server to start.
|
|
784
|
+
|
|
785
|
+
**`--define` values originally need to be JSON, so a bare string has to
|
|
786
|
+
arrive already quoted** — `--define process.env.SERVE_AUTO_OPEN=/index.html`
|
|
787
|
+
would fail if directly passed to `bun build`, which tries to parse
|
|
788
|
+
`/index.html` as a JS expression. `src/main.js` calls
|
|
789
|
+
`stringifyNonPrimitiveDefineValues` (from
|
|
790
|
+
`single-exe/compiled.js`, the same helper the npm package `jsmdcui` uses for
|
|
791
|
+
its own `--define`-backed settings) once per `SERVE_*` name before
|
|
792
|
+
`buildEarlyExit` runs, so it quotes any string-shaped value for you and
|
|
793
|
+
leaves an already valid bare literal (a number, boolean, `null`, or
|
|
794
|
+
`undefined` — e.g. `=1`) untouched. `off`, `on`, and a `/`-led path are all
|
|
795
|
+
string-shaped, so they get quoted automatically; that's what makes the
|
|
796
|
+
unquoted `=on` / `=/index.html` / `=1` forms above work directly from a
|
|
797
|
+
shell, no manual `--define 'process.env.SERVE_AUTO_OPEN="/index.html"'`
|
|
798
|
+
quoting required.
|
|
799
|
+
|
|
800
|
+
### The `curl` command
|
|
801
|
+
|
|
802
|
+
`curl [options] URL...` transfers a URL over HTTP or HTTPS on top of Bun's own
|
|
803
|
+
`fetch`, so a device with no `curl` binary can still run the download and API
|
|
804
|
+
scripts that expect one. It is a PATH-fallback builtin: a real `curl` in
|
|
805
|
+
`PATH` wins unless it is invoked as `builtin curl ...`.
|
|
806
|
+
|
|
807
|
+
- A URL with no scheme gets one — `http://` normally, `https://` when the port
|
|
808
|
+
is `443`, or whatever `--proto-default` names — so `curl localhost:8080` and
|
|
809
|
+
`curl example.com/page` work as they do with the real curl.
|
|
810
|
+
- Downloads: `-o`, `-O`, `-J`, `--output-dir`, `--create-dirs`, `-a`, and
|
|
811
|
+
`-C -` resume through a `Range` request, appending on `206`, rewriting on a
|
|
812
|
+
`200` that ignored the range, and stopping cleanly on `416`.
|
|
813
|
+
- Requests: `-X`, `-H`, `-d`/`--data-raw`/`--data-binary`/`--data-ascii`,
|
|
814
|
+
`--data-urlencode`, `--json`, `-G`, `-F`/`--form-string`, `-T`, `-u`,
|
|
815
|
+
`--oauth2-bearer`, `-A`, `-e`, `-b`, `-r`, `--compressed`, and `-x`.
|
|
816
|
+
`@file` and `@-` read a body from a file or stdin.
|
|
817
|
+
- Responses: `-i`, `-I`, `-D`, `-w` with the usual `%{variable}` set, `-L`
|
|
818
|
+
with `--max-redirs` and the `301`/`302`/`303` POST-to-GET rule, `-f`,
|
|
819
|
+
`--fail-with-body`, `-k`, `-m`, `--connect-timeout`, and `--retry`.
|
|
820
|
+
- Reporting: `-s`, `-S`, `-v`, `-#`, and a curl-shaped progress meter, shown
|
|
821
|
+
only when the body is not being painted on the terminal.
|
|
822
|
+
- curl's exit codes are reproduced: `22` for `-f` on an HTTP error, `6` for an
|
|
823
|
+
unresolved host, `7` for a refused connection, `28` for a timeout, `47` for
|
|
824
|
+
too many redirects, `60` for a certificate problem, `2` for bad usage.
|
|
825
|
+
- Bodies are streamed, so `curl -N` on a server-sent-events endpoint prints
|
|
826
|
+
each chunk as it arrives, and a large download never buffers in memory.
|
|
827
|
+
|
|
828
|
+
Enough to drive a JSON API:
|
|
829
|
+
|
|
830
|
+
```sh
|
|
831
|
+
curl -sS https://api.openai.com/v1/chat/completions \
|
|
832
|
+
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
|
833
|
+
-H 'Content-Type: application/json' \
|
|
834
|
+
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
Response headers come from `fetch`, which lower-cases them and hides the
|
|
838
|
+
negotiated HTTP version, so `-i`/`-I`/`-v` rebuild the conventional casing and
|
|
839
|
+
write `HTTP/1.1` status lines; Bun also adds a `Connection: keep-alive`
|
|
840
|
+
request header of its own. `builtin curl --help` documents the rest.
|
|
841
|
+
|
|
842
|
+
### PATH-fallback builtins
|
|
843
|
+
|
|
844
|
+
Fallback builtins normally let an executable in `PATH` win. To use the fancy
|
|
845
|
+
implementations by default even when the system provides `cat` and `ls`, make
|
|
846
|
+
aliases that explicitly select the builtin commands:
|
|
847
|
+
|
|
848
|
+
```sh
|
|
849
|
+
alias cat='builtin catfancy'
|
|
850
|
+
alias ls='builtin lsfancy'
|
|
851
|
+
alias ps='builtin pspac'
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
After that, `cat README.md` renders Markdown with ANSI styling and terminal
|
|
855
|
+
hyperlinks, while `ls` uses the emoji and terminal-width-aware listing. Use
|
|
856
|
+
`unalias cat ls` to restore normal PATH-first lookup for the current shell.
|
|
857
|
+
|
|
858
|
+
| Command | Supported flags/forms |
|
|
859
|
+
| --- | --- |
|
|
860
|
+
| `basename` | `--`, optional suffix |
|
|
861
|
+
| `dirname` | `--` |
|
|
862
|
+
| `cat` | `--exclude PATTERN`, `--exclude=PATTERN` using `Bun.Glob`, `--`; files and `-` for stdin |
|
|
863
|
+
| `tac` | `--`; files and `-` for stdin; reverses newline-delimited records in each operand; no other options |
|
|
864
|
+
| `catfancy` | `--exclude PATTERN`, `--exclude=PATTERN` using `Bun.Glob`, `--`; files and `-` for stdin; JSON, JSON5, JSONC, JSONL/NDJSON, YAML, TOML, and XML are parsed, pretty-printed as JSON, and colored with `Bun.color`; Markdown uses `Bun.markdown.ansi` with terminal hyperlinks; `.js`/`.mjs`/`.cjs`/`.jsx` and `.ts`/`.mts`/`.cts`/`.tsx` are wrapped in a fenced ` ```javascript `/` ```typescript ` block and rendered the same way, for the same syntax coloring; other formats are emitted unchanged |
|
|
865
|
+
| `head` | `-n N`, `-N`, `-c N`, `-cN` |
|
|
866
|
+
| `tail` | `-n N`, `-N`; `-n +N` and `-n+N` output starting at line N |
|
|
867
|
+
| `wc` | `-l`, `-w`, `-c`, combinable |
|
|
868
|
+
| `tr` | `-d`; simple ranges such as `a-z` |
|
|
869
|
+
| `tee` | `-a` |
|
|
870
|
+
| `sleep` | Durations with `ms`, `s`, `m`, `h` suffixes; seconds by default |
|
|
871
|
+
| `clear` | No flags |
|
|
872
|
+
| `rmdir` | `-p`, `--parents` |
|
|
873
|
+
| `mktemp` | `-d`; template must end in `XXXXXX` |
|
|
874
|
+
| `sort` | `-r`, `-n`, `-u`, combinable |
|
|
875
|
+
| `date` | `+FORMAT`; `%Y`, `%m`, `%d`, `%H`, `%M`, `%S`, `%s`, `%F`, `%T`, `%%` |
|
|
876
|
+
| `md5sum`, `sha256sum` | Files or stdin; no flags |
|
|
877
|
+
| `grep` | `-E`, `-F`, `-i`, `-q`, `-v`, `-n`, `-o`, `-r`, `-x`, combinable; `--color[=always\|auto\|never]` (`--colour` also accepted) |
|
|
878
|
+
| `sed` | `-n`, `-e SCRIPT`, `-eSCRIPT`, `-E`, `-r`, `-i`; numeric `p`; `s///` with `g` and `p` |
|
|
879
|
+
| `cut` | `-c LIST`, `-cLIST` |
|
|
880
|
+
| `ln` | `-s`, `-f`, `-T`, combinable (including `-sfT`) |
|
|
881
|
+
| `chmod` | Octal modes, `+x`, `a+x` |
|
|
882
|
+
| `uname` | `-a`, `-s`, `-n`, `-r`, `-v`, `-m`, `-p`, combinable (including `-mprs`); uses Node's OS APIs on Windows without `/proc` |
|
|
883
|
+
| `pspa` | Lists every process as a PID and its full command line, with no options; `ps -eo pid,args` passed through on POSIX, the same two columns queried from `Win32_Process` through PowerShell on Windows |
|
|
884
|
+
| `pspac` | The same listing, coloured: the PID as a number, and the command line highlighted as shell syntax with micro's `syntax/sh.yaml` rules and `colorschemes/monokai.micro` colours, plus a dimmed leading directory and the program's own name coloured as the command it is. Always colours, like `catfancy`; strip the colour and the output is `pspa`'s |
|
|
885
|
+
| `find` | Paths plus `-name`, `-iname`, `-path`, `-ipath`, `-type f/d/l`, `-mindepth`, `-maxdepth`, `-print`, `-print0`, `!`/`-not`, `-exec COMMAND {} \;`, `-exec COMMAND {} +`; regular builtin on Windows, PATH fallback elsewhere |
|
|
886
|
+
| `bunmsh` | Forwards all following arguments to this bunmsh entry point |
|
|
887
|
+
| `bun` | Forwards all following arguments to the active Bun runtime |
|
|
888
|
+
| `serve` | Auto-open, minapk WebView, and high-entropy random-URL flags; see [The `serve` command](#the-serve-command) above |
|
|
889
|
+
| `curl` | HTTP/HTTPS transfers on Bun's `fetch`, with automatic scheme guessing; `-o`, `-O`, `-J`, `--output-dir`, `--create-dirs`, `-a`, `-C`, `-D`, `-i`, `-I`, `-w`, `-X`, `-H`, `-d`, `--data-raw`, `--data-binary`, `--data-ascii`, `--data-urlencode`, `--json`, `-G`, `-F`, `--form-string`, `-T`, `-u`, `--oauth2-bearer`, `-A`, `-e`, `-b`, `-r`, `--compressed`, `-x`, `-L`, `--location-trusted`, `--max-redirs`, `-f`, `--fail-with-body`, `-k`, `-m`, `--connect-timeout`, `--retry` and friends, `-s`, `-S`, `-v`, `-#`, `--no-progress-meter`, `-V`, `--url`, `--proto-default`, combinable short clusters (`-kLO`, `-fsSL`, `-kfsS`, `-#k`); TLS-material and connection-tuning options are parsed and ignored; see [The `curl` command](#the-curl-command) above |
|
|
890
|
+
| `ls`, `lsfancy` | The `ls` fallback is `lsfancy`: emoji and terminal-width-aware directory listing; `-a`, `-A`, `-d`, `-l`, `-h`, `-t`, `-r`, `-R`, `-S`, `-1`, `-F`, combinable (including `-lh`, `-ltr`, and `-lSF`); `-l` shows a symlink's target (`link -> target`, including a broken one), and a symlink whose target can't be resolved (missing, or a cycle) gets a 🚫 icon instead of 🔗; `-F` appends a classify suffix (`/` directory, `@` symlink, `*` executable, `=` socket, `\|` FIFO); always reads the directory without using the completion cache |
|
|
891
|
+
| `lsbun` | Bun Shell's own `ls`, kept reachable under this name now that the `ls` fallback is `lsfancy`; currently implements `-a`, `-A`, `-d`, `-l`, `-R` |
|
|
892
|
+
| `mv` | Bun Shell currently accepts `-f`, `-h`, `-i`, `-n`, `-v`, but they do not change its behaviour; notably, `-i` and `-n` do not prevent overwriting |
|
|
893
|
+
| `rm` | Bun Shell currently implements `-f`, `-r`, `-R`, `-v`, `-d`, `-i`, `-I`, `--recursive`, `--verbose`, `--dir`, and `--interactive=never|once|always`; `--preserve-root` and `--no-preserve-root` are accepted but currently have no effect |
|
|
894
|
+
| `mkdir` | Bun Shell currently implements `-p`, `-v`, `--parents`, and `--vebose` (Bun's currently accepted spelling) |
|
|
895
|
+
| `seq` | Bun Shell currently accepts `-s`/`--separator`, `-t`/`--terminator`, and `-w`/`--fixed-width`; its formatting differs from GNU `seq` (`-w` does not currently pad, and a custom separator may also be emitted after the final item) |
|
|
896
|
+
| `touch` | Bun Shell fallback currently supports no flags |
|
|
897
|
+
| `cp` | `-r`, `-R`, `-v`; bunmsh converts `-r` to Bun Shell's `-R`. Bun Shell also accepts `-n`, but it currently has no effect |
|
|
898
|
+
|
|
899
|
+
Fallback commands preserve the system-command-first rule. For example, if
|
|
900
|
+
`/bin/grep` exists it runs instead of the fallback; `builtin grep ...` forces
|
|
901
|
+
the implementation described above.
|
|
902
|
+
|
|
903
|
+
The Bun Shell rows above describe the currently tested Bun implementation, not
|
|
904
|
+
a permanent compatibility guarantee. Their supported flags and exact behaviour
|
|
905
|
+
may change with later Bun releases; see [bunshell.md](bunshell.md) for the
|
|
906
|
+
detailed compatibility snapshot.
|
|
907
|
+
|
|
908
|
+
## What's implemented
|
|
909
|
+
|
|
910
|
+
- Interactive use, stdin and script files, `-c` shell text, and direct `-cc`
|
|
911
|
+
argv forwarding.
|
|
912
|
+
- Highest-priority `Bun.*` JavaScript evaluation, including awaited promises,
|
|
913
|
+
command substitution, and the `Bun.e;`/`Bun.e,` arbitrary-JavaScript forms.
|
|
914
|
+
- Concurrent streaming pipelines and streamed redirects built on `Bun.spawn`,
|
|
915
|
+
including large output and early-closing consumers.
|
|
916
|
+
- Shell lists, pipelines, negation, functions, subshells, and `if`, `case`,
|
|
917
|
+
`while`, `until`, and `for` compound commands.
|
|
918
|
+
- Quotes, parameter/command/arithmetic expansion, IFS field splitting, tilde,
|
|
919
|
+
brace, and pathname expansion.
|
|
920
|
+
- Environment assignments, aliases, readonly names, positional parameters,
|
|
921
|
+
shell functions, common redirections, `2>&1` descriptor duplication,
|
|
922
|
+
here-documents (`<<`/`<<-`, with quoted/escaped delimiters suppressing
|
|
923
|
+
expansion), and mksh-style here-strings (`<<<`).
|
|
924
|
+
- Regular builtins, system-command-first fallback builtins, Bun Shell fallbacks,
|
|
925
|
+
and explicit lookup through `command`, `builtin`, `whence`, `type`, and
|
|
926
|
+
`which`.
|
|
927
|
+
- Interactive history import/save/recall, command, file, and shell-variable
|
|
928
|
+
completion, ghost
|
|
929
|
+
suggestions, cwd tabs, keyboard shortcuts, optional mouse interactions,
|
|
930
|
+
fancy directory listings, and a `PS2` continuation prompt while a
|
|
931
|
+
here-document, an open quote/substitution, or an unfinished compound
|
|
932
|
+
command is still being typed.
|
|
933
|
+
- A `curl` fallback built on `fetch`, covering downloads with resume, JSON and
|
|
934
|
+
form request bodies, redirects, timeouts, retries, `--write-out` reporting,
|
|
935
|
+
and curl's exit codes.
|
|
936
|
+
- A `pspa` process listing that works the same way on POSIX and Windows, and a
|
|
937
|
+
`pspac` that colours it as shell syntax.
|
|
938
|
+
- Linux, Android/Termux, macOS, and Windows-aware paths, plus standalone builds
|
|
939
|
+
and dynamic-linker re-execution support.
|
|
940
|
+
|
|
941
|
+
See [PORTING.md](PORTING.md) for detailed semantics, implementation boundaries,
|
|
942
|
+
platform notes, and the remaining mksh/POSIX compatibility work.
|
|
943
|
+
|
|
944
|
+
## Test
|
|
945
|
+
|
|
946
|
+
```sh
|
|
947
|
+
bun test
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
## Built-in documentation
|
|
951
|
+
|
|
952
|
+
Show the README or changelog in the terminal with ANSI formatting:
|
|
953
|
+
|
|
954
|
+
```sh
|
|
955
|
+
bunmsh --readme
|
|
956
|
+
bunmsh --changelog
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
Both commands read their embedded copy first when running a standalone
|
|
960
|
+
executable, then fall back to `README.md` or `CHANGELOG.md` in the repository
|
|
961
|
+
during development.
|
|
962
|
+
|
|
963
|
+
Every builtin's `--help` page lives in `help/`, and `help/README.md` is the
|
|
964
|
+
concatenation of all of them. Regenerate it with the shell's own `cat` after
|
|
965
|
+
adding or editing a page:
|
|
966
|
+
|
|
967
|
+
```sh
|
|
968
|
+
bun run genallhelp
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
which runs `builtin cat --exclude help/README.md help/*.md` and writes the
|
|
972
|
+
result back over `help/README.md`.
|
|
973
|
+
|
|
974
|
+
## Standalone executable
|
|
975
|
+
|
|
976
|
+
Build a single-file executable for the current platform:
|
|
977
|
+
|
|
978
|
+
```sh
|
|
979
|
+
bun ./src/main.js --build-exe
|
|
980
|
+
./bmsh --version
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
Cross-compile for a Bun-supported target:
|
|
984
|
+
|
|
985
|
+
```sh
|
|
986
|
+
bun ./src/main.js --build-for bun-linux-x64
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
The build writes `./bmsh` and leaves the repository's `./bunmsh` launcher
|
|
990
|
+
unchanged. The executable includes the runtime assets declared in
|
|
991
|
+
`package.json`, currently including its README and changelog. See
|
|
992
|
+
[`single-exe/README.md`](single-exe/README.md) for asset-management options.
|
|
993
|
+
|
|
994
|
+
## License
|
|
995
|
+
|
|
996
|
+
The original bunmsh JavaScript implementation is released under the
|
|
997
|
+
[MIT License](LICENSE), Copyright (c) 2026 Dr. John (醫者小智).
|
|
998
|
+
|
|
999
|
+
mksh is a separate upstream project and is **not** relicensed under MIT. Its
|
|
1000
|
+
complete licence terms remain in [LICENSE-MKSH](LICENSE-MKSH).
|
|
1001
|
+
|
|
1002
|
+
### Syntax highlighting
|
|
1003
|
+
|
|
1004
|
+
The shell-syntax colouring `pspac` applies to the COMMAND column follows
|
|
1005
|
+
`runtime/syntax/sh.yaml` from [micro](https://github.com/zyedidia/micro), the
|
|
1006
|
+
Go terminal editor. Nothing is bundled: its rules — the keyword,
|
|
1007
|
+
command-name, flag, variable, string, and comment patterns, the word lists
|
|
1008
|
+
behind them, and the order they resolve in — were transcribed into
|
|
1009
|
+
`src/shell.js`. Micro's syntax files are MIT ("Expat"), Copyright (c) 2020:
|
|
1010
|
+
Zachary Yedidia, et al.; micro's own `syntax/README.md` records that they
|
|
1011
|
+
originate from Nano's [`nanorc`](https://github.com/scopatz/nanorc)
|
|
1012
|
+
collection.
|
|
1013
|
+
|
|
1014
|
+
The colours those classes are painted in are the colour-links of micro's
|
|
1015
|
+
`runtime/colorschemes/monokai.micro` — micro itself is MIT, Copyright (c)
|
|
1016
|
+
2016-2020: Zachary Yedidia, et al. — which renders the Monokai palette created
|
|
1017
|
+
by Wimer Hazenberg. `catfancy` takes five of the same colour-links for its
|
|
1018
|
+
JSON keys, strings, numbers, escapes, and constants, so both commands read as
|
|
1019
|
+
one scheme rather than two.
|
|
1020
|
+
|
|
1021
|
+
Micro's terms are in [LICENSE-MICRO](LICENSE-MICRO); upstream they are
|
|
1022
|
+
`runtime/syntax/LICENSE` and `LICENSE` in
|
|
1023
|
+
[zyedidia/micro](https://github.com/zyedidia/micro), which is where to trace
|
|
1024
|
+
either of them from.
|
|
1025
|
+
|
|
1026
|
+
### Licences in a compiled executable
|
|
1027
|
+
|
|
1028
|
+
`LICENSE`, `LICENSE-MKSH`, and `LICENSE-MICRO` are packaged assets, so a
|
|
1029
|
+
standalone build carries them inside the binary rather than leaving the notices
|
|
1030
|
+
behind in the repository. Reading them back depends on which asset back end the
|
|
1031
|
+
build used:
|
|
1032
|
+
|
|
1033
|
+
```sh
|
|
1034
|
+
./bmsh --assets-extract # tar back end (the default)
|
|
1035
|
+
./bmsh -cc builtin serve 'B:/~BUN' # ASSETS_BUNFS=1 build
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
[`--assets-extract`](#standalone-executable) writes every asset beside the
|
|
1039
|
+
executable, licences included, under `assets/bunmsh@<version>/`. For a bunfs
|
|
1040
|
+
build, [serving `B:/~BUN`](#serving-a-folder-packed-into-the-executable)
|
|
1041
|
+
browses the binary's own virtual root, where the same files sit under
|
|
1042
|
+
`/assets/bunmsh@<version>/`.
|