buninu 0.3.0 → 0.3.1

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.
Files changed (118) hide show
  1. package/README.md +21 -0
  2. package/apps/bunmsh/CHANGELOG.md +262 -0
  3. package/apps/bunmsh/LICENSE +21 -0
  4. package/apps/bunmsh/LICENSE-MKSH +295 -0
  5. package/apps/bunmsh/PORTING.md +192 -0
  6. package/apps/bunmsh/README.md +801 -0
  7. package/apps/bunmsh/bunmsh +7 -0
  8. package/apps/bunmsh/bunshell.md +61 -0
  9. package/apps/bunmsh/help/README.md +1945 -0
  10. package/apps/bunmsh/help/alias.md +22 -0
  11. package/apps/bunmsh/help/basename.md +38 -0
  12. package/apps/bunmsh/help/builtin.md +25 -0
  13. package/apps/bunmsh/help/bun.md +27 -0
  14. package/apps/bunmsh/help/bunmsh.md +47 -0
  15. package/apps/bunmsh/help/cat.md +31 -0
  16. package/apps/bunmsh/help/catfancy.md +35 -0
  17. package/apps/bunmsh/help/cd.md +22 -0
  18. package/apps/bunmsh/help/chmod.md +27 -0
  19. package/apps/bunmsh/help/clear.md +21 -0
  20. package/apps/bunmsh/help/colon.md +22 -0
  21. package/apps/bunmsh/help/command.md +27 -0
  22. package/apps/bunmsh/help/cp.md +28 -0
  23. package/apps/bunmsh/help/cut.md +25 -0
  24. package/apps/bunmsh/help/date.md +25 -0
  25. package/apps/bunmsh/help/dirname.md +25 -0
  26. package/apps/bunmsh/help/echo.md +25 -0
  27. package/apps/bunmsh/help/env.md +27 -0
  28. package/apps/bunmsh/help/eval.md +22 -0
  29. package/apps/bunmsh/help/exec.md +22 -0
  30. package/apps/bunmsh/help/exit.md +21 -0
  31. package/apps/bunmsh/help/export.md +22 -0
  32. package/apps/bunmsh/help/false.md +22 -0
  33. package/apps/bunmsh/help/find.md +33 -0
  34. package/apps/bunmsh/help/getopts.md +28 -0
  35. package/apps/bunmsh/help/grep.md +34 -0
  36. package/apps/bunmsh/help/head.md +27 -0
  37. package/apps/bunmsh/help/kill.md +27 -0
  38. package/apps/bunmsh/help/ln.md +28 -0
  39. package/apps/bunmsh/help/ls.md +37 -0
  40. package/apps/bunmsh/help/lsbun.md +29 -0
  41. package/apps/bunmsh/help/lsfancy.md +37 -0
  42. package/apps/bunmsh/help/md5sum.md +21 -0
  43. package/apps/bunmsh/help/mkdir.md +27 -0
  44. package/apps/bunmsh/help/mktemp.md +26 -0
  45. package/apps/bunmsh/help/mv.md +26 -0
  46. package/apps/bunmsh/help/print.md +30 -0
  47. package/apps/bunmsh/help/printf.md +25 -0
  48. package/apps/bunmsh/help/pwd.md +21 -0
  49. package/apps/bunmsh/help/read.md +27 -0
  50. package/apps/bunmsh/help/readonly.md +27 -0
  51. package/apps/bunmsh/help/realpath.md +21 -0
  52. package/apps/bunmsh/help/rm.md +33 -0
  53. package/apps/bunmsh/help/rmdir.md +27 -0
  54. package/apps/bunmsh/help/sed.md +29 -0
  55. package/apps/bunmsh/help/seq.md +29 -0
  56. package/apps/bunmsh/help/serve.md +50 -0
  57. package/apps/bunmsh/help/set.md +26 -0
  58. package/apps/bunmsh/help/sha256sum.md +21 -0
  59. package/apps/bunmsh/help/shift.md +23 -0
  60. package/apps/bunmsh/help/sleep.md +25 -0
  61. package/apps/bunmsh/help/sort.md +29 -0
  62. package/apps/bunmsh/help/source.md +23 -0
  63. package/apps/bunmsh/help/tab.md +30 -0
  64. package/apps/bunmsh/help/tac.md +29 -0
  65. package/apps/bunmsh/help/tail.md +27 -0
  66. package/apps/bunmsh/help/tee.md +25 -0
  67. package/apps/bunmsh/help/test.md +30 -0
  68. package/apps/bunmsh/help/time.md +29 -0
  69. package/apps/bunmsh/help/touch.md +26 -0
  70. package/apps/bunmsh/help/tr.md +26 -0
  71. package/apps/bunmsh/help/true.md +22 -0
  72. package/apps/bunmsh/help/type.md +21 -0
  73. package/apps/bunmsh/help/umask.md +22 -0
  74. package/apps/bunmsh/help/unalias.md +28 -0
  75. package/apps/bunmsh/help/uname.md +31 -0
  76. package/apps/bunmsh/help/unset.md +28 -0
  77. package/apps/bunmsh/help/wc.md +27 -0
  78. package/apps/bunmsh/help/whence.md +26 -0
  79. package/apps/bunmsh/help/which.md +41 -0
  80. package/apps/bunmsh/help/yes.md +23 -0
  81. package/apps/bunmsh/package.json +26 -0
  82. package/apps/bunmsh/serve.js +468 -0
  83. package/apps/bunmsh/single-exe/README.md +402 -0
  84. package/apps/bunmsh/single-exe/assetsHelper.js +371 -0
  85. package/apps/bunmsh/single-exe/assetsLoader.mjs +85 -0
  86. package/apps/bunmsh/single-exe/assetsPacker.js +218 -0
  87. package/apps/bunmsh/single-exe/compiled.js +527 -0
  88. package/apps/bunmsh/single-exe/entry.mjs +17 -0
  89. package/apps/bunmsh/src/cat-fancy.js +117 -0
  90. package/apps/bunmsh/src/cat-operands.js +31 -0
  91. package/apps/bunmsh/src/completion.js +247 -0
  92. package/apps/bunmsh/src/environment.js +61 -0
  93. package/apps/bunmsh/src/fancy-ls.js +186 -0
  94. package/apps/bunmsh/src/find.js +119 -0
  95. package/apps/bunmsh/src/history.js +198 -0
  96. package/apps/bunmsh/src/main.js +776 -0
  97. package/apps/bunmsh/src/mouse.js +103 -0
  98. package/apps/bunmsh/src/shell.js +3557 -0
  99. package/apps/bunmsh/test/catfancy.test.js +102 -0
  100. package/apps/bunmsh/test/reference-source.sh +1 -0
  101. package/apps/bunmsh/test/reference.test.js +677 -0
  102. package/apps/bunmsh/test/serve/README.md +3 -0
  103. package/apps/bunmsh/test/serve/bad.json +1 -0
  104. package/apps/bunmsh/test/serve/data.json +1 -0
  105. package/apps/bunmsh/test/serve/data.json5 +1 -0
  106. package/apps/bunmsh/test/serve/data.jsonc +2 -0
  107. package/apps/bunmsh/test/serve/data.jsonl +2 -0
  108. package/apps/bunmsh/test/serve/data.ndjson +1 -0
  109. package/apps/bunmsh/test/serve/data.toml +3 -0
  110. package/apps/bunmsh/test/serve/data.ts +15 -0
  111. package/apps/bunmsh/test/serve/data.xml +1 -0
  112. package/apps/bunmsh/test/serve/data.yaml +3 -0
  113. package/apps/bunmsh/test/serve/data.yml +1 -0
  114. package/apps/bunmsh/test/serve.test.js +241 -0
  115. package/apps/bunmsh/test/shell.test.js +1778 -0
  116. package/apps/bunmsh/test/t.sh +12 -0
  117. package/bin/init.js +11 -3
  118. package/package.json +2 -1
package/README.md CHANGED
@@ -52,6 +52,8 @@ On Linux and Windows, follow the
52
52
 
53
53
  ## Start
54
54
 
55
+ ### Start a remote shell in a Browser
56
+
55
57
  Run the npm package:
56
58
 
57
59
  ```sh
@@ -82,6 +84,25 @@ remaining argument forwarded to it, and exits with its exit code. Use this to
82
84
  reach an app's own options directly, for example `npx buninu --jsgotty --help`
83
85
  to see jsgotty's actual flag reference instead of Buninu's.
84
86
 
87
+ ### Start a local shell in a Terminal (experimental)
88
+
89
+ Drops you straight into [bunmsh](apps/bunmsh/README.md) (Bun Modern Shell), a
90
+ dependency-free, mksh-inspired command shell that runs on Bun, without going
91
+ through the browser/jsgotty flow.
92
+
93
+ ```sh
94
+ npx buninu --local
95
+ ```
96
+
97
+ Or run it from a source checkout:
98
+
99
+ ```sh
100
+ bun ./bin/init.js --local
101
+ ```
102
+
103
+ Buninu's own tools (`rz`, `sz`, `showimg`, `tts`, `xdg-open`, `native-bridge`,
104
+ etc.) stay available inside this shell too, same as in the browser session.
105
+
85
106
  ## Security
86
107
 
87
108
  `scripts.start` binds jsgotty to `127.0.0.1` by default, so the terminal
@@ -0,0 +1,262 @@
1
+ # Changelog
2
+
3
+ All notable user-visible changes to bunmsh are documented here.
4
+
5
+ ## [0.2.0] - 2026-08-29
6
+
7
+ ### Added
8
+
9
+ - Add `SERVE_AUTO_OPEN`, `SERVE_MINAPK_WEBVIEW`, and `SERVE_RANDOM_URL` plus
10
+ overriding `serve` CLI flags for opening the server (cross-platform, with
11
+ `xdg-open` on PATH preferred), targeting the npm `buninu` package's app
12
+ WebView, and protecting it behind a high-entropy random URL prefix.
13
+ - Add repeatable `--exclude PATTERN` and `--exclude=PATTERN` filtering backed
14
+ by `Bun.Glob` to the `cat` and `catfancy` fallback builtins for concatenating
15
+ expanded file sets.
16
+ - Add JS/TS syntax coloring to `catfancy`: `.js`/`.mjs`/`.cjs`/`.jsx` and
17
+ `.ts`/`.mts`/`.cts`/`.tsx` files are wrapped in a fenced ` ```javascript `/
18
+ ` ```typescript ` block and rendered through the same `Bun.markdown.ansi`
19
+ path Markdown gets, reusing its code-block highlighter rather than adding
20
+ one. The fence is widened past the longest run of backticks already in the
21
+ source, so a file containing its own triple-backtick text can't prematurely
22
+ close it.
23
+ - Add bracketed-paste support to the interactive prompt. A paste containing a
24
+ newline no longer gets read back a physical line at a time (which broke any
25
+ `\`-continued command in it, since each line ran on its own the instant its
26
+ line-ending arrived); it now resolves as a single already-typed line, going
27
+ through the same continuation/execute path Enter does, so a whole
28
+ multi-command, `\`-continued tutorial block can be pasted and run as-is. A
29
+ paste's own line-ending convention — `\n`, `\r\n`, or a bare `\r` (some
30
+ terminals use it for pasted content, even though bunmsh's parser otherwise
31
+ treats a standalone `\r` as whitespace) — is normalized before anything
32
+ downstream sees it. A single-line paste is unaffected. Independent of
33
+ `--mouse`/`BUNMSH_MOUSE`.
34
+
35
+ ### Fixed
36
+
37
+ - Recognize a line ending in a bare trailing backslash as an interactive
38
+ continuation request. Previously, typing `echo hi \` and pressing Enter ran
39
+ it immediately as `echo`, `hi`, `\` instead of showing the PS2 prompt and
40
+ waiting for the next line, because the interactive line-by-line `pending`
41
+ buffer only had the lone `\` at that point — the following `\n` that the
42
+ existing backslash-newline splice looks for hadn't been typed yet.
43
+
44
+ ## [0.1.11] - 2026-08-28
45
+
46
+ ### Added
47
+
48
+ - Add a `tac` PATH-fallback builtin for reversing newline-delimited records
49
+ from files or stdin while preserving their bytes and separators.
50
+ - Add asset-backed `-h` and `--help` output for documented regular and fallback
51
+ builtins. Help lives as Markdown under `help/`, starts at level-two headings,
52
+ and renders through `Bun.markdown.ansi` with terminal hyperlinks enabled.
53
+ - Add the `catfancy` PATH-fallback builtin. Previewable data formats are
54
+ parsed and emitted as colorized pretty JSON; Markdown is rendered with
55
+ `Bun.markdown.ansi` and hyperlinks enabled, while unrecognized formats pass
56
+ through unchanged.
57
+
58
+ ### Fixed
59
+
60
+ - Normalize CRLF source to LF at every shell-language input boundary, covering
61
+ script files, stdin, `-c`, interactive continuation, command substitutions,
62
+ compound syntax, quoted text, and here-documents. A standalone carriage
63
+ return remains untouched.
64
+ - Treat backslash followed by either LF or CRLF as a line continuation before
65
+ token recognition. This supports indented multi-line command invocations
66
+ without introducing empty arguments, including `enter_rootfs.sh`-style
67
+ multi-line `exec` commands.
68
+ - Stream top-level compound-command output directly to the terminal. An
69
+ interactive program launched by `exec` inside `if`, loops, or other compound
70
+ syntax previously inherited stdin but had stdout and stderr buffered until
71
+ it exited, making an entered rootfs appear to hang with a blank screen.
72
+
73
+ ## [0.1.10] - 2026-08-27
74
+
75
+ ### Added
76
+
77
+ - Add `<<`/`<<-` here-documents. An unquoted, unescaped delimiter expands
78
+ parameters, command substitution, and arithmetic in the body like a
79
+ double-quoted string; a quoted or backslash-escaped delimiter (`<<'EOF'`,
80
+ `<<\EOF`) leaves it literal. `<<-` strips leading tabs from the body and the
81
+ terminator. Here-documents work on plain command lines, in pipelines, across
82
+ multiple heredocs on one command, and inside `if`/`while`/`for`/`case`
83
+ bodies. Like dash and bash, a script that ends before the terminator line
84
+ appears uses whatever was read as the body instead of raising a syntax
85
+ error.
86
+ - Add `<<<` here-strings, matching mksh's `DOHERESTR | DOSCALAR` word
87
+ expansion: parameter, command, and arithmetic substitution run, but there is
88
+ no field splitting, pathname expansion, or tilde expansion, and a trailing
89
+ newline is appended before the word becomes stdin.
90
+ - Fix an unrelated pre-existing crash surfaced while adding here-documents: any
91
+ tokenizer syntax error (for example an unterminated quote) raised while
92
+ probing whether a script uses compound (`if`/`while`/`for`/`case`) syntax
93
+ used to escape as an unhandled exception instead of the usual
94
+ `bunmsh: syntax error: ...` message.
95
+ - Show mksh's `PS2` continuation prompt (default `"> "`) in interactive mode
96
+ while a here-document, an open quote/substitution, or an unfinished
97
+ `if`/`while`/`for`/`case` body is still being typed, instead of running each
98
+ line on its own as soon as Enter is pressed. Ctrl-C during a continuation
99
+ discards it and returns to the primary prompt; Ctrl-D runs whatever was
100
+ typed so far — the same leniency the non-interactive here-document fallback
101
+ above already has — and then keeps the shell running (Node's `readline`
102
+ closes itself on an empty-line Ctrl-D, so this transparently rebuilds it),
103
+ the same as mksh, instead of exiting the whole session.
104
+ - `lsfancy -l` now shows a symlink's target (`link -> target`), including a
105
+ broken one, matching real `ls` — this was missing from both `lsfancy` and
106
+ the Bun Shell `ls` fallback it is compared against. Reading it works the
107
+ same way on Windows as on POSIX platforms.
108
+ - Give a symlink whose target does not resolve (missing, or a cycle) a
109
+ distinct 🚫 icon instead of the normal 🔗, in both the plain and `-l`
110
+ listing forms.
111
+ - With mouse tracking enabled, clicking inside the line currently being typed
112
+ now moves the cursor there (accounting for the active prompt's own width
113
+ and wrapping, including multi-line/multi-tab prompts and the `PS2`
114
+ continuation prompt), the same as clicking inside a text field, instead of
115
+ only reacting to clicks on tabs. Clicking past the end of the typed text
116
+ moves the cursor to the end of the line rather than doing nothing.
117
+ - Add `-S` (sort by size, largest first), `-1` (force one entry per line,
118
+ even in a terminal), and `-F` (append a classify suffix — `/` directory,
119
+ `@` symlink, `*` executable, `=` socket, `|` FIFO) to `lsfancy`, all
120
+ combinable with the existing flags (`-lSF`, etc.).
121
+ - Save history automatically — every 60s, once more on exit, and once more
122
+ on SIGTERM/SIGHUP — by appending only this session's own new commands to a
123
+ JSON Lines history file, never rewriting it, so several bunmsh sessions
124
+ saving around the same time can no longer overwrite each other's history.
125
+ `tab s`/`tab save` trigger the same append immediately; the new `tab s d`/
126
+ `tab save dedupe` is a separate, explicit whole-file rewrite that drops
127
+ duplicate commands and reports if another session's write raced it. A
128
+ history file saved in the previous single-JSON-array format is still read
129
+ correctly and is silently upgraded to JSON Lines the next time anything
130
+ is saved.
131
+ - Catch SIGTERM and SIGHUP in interactive mode instead of leaving them at
132
+ the default disposition (which killed bunmsh immediately, before it could
133
+ save anything). Receiving either while waiting at the prompt now flushes
134
+ history and exits with the conventional 128+signal status; while a
135
+ foreground command owns the terminal, it flushes history immediately and
136
+ exits once that command finishes on its own, since there is no
137
+ job-control layer yet to also stop the command itself.
138
+
139
+ ### Changed
140
+
141
+ - `tab s`/`tab save` (with no `d`/`dedupe`) no longer removes duplicate
142
+ commands as a side effect of saving — it now only appends, matching how
143
+ most shells' history files work. Use the new `tab s d`/`tab save dedupe`
144
+ to remove duplicates explicitly.
145
+ - The `ls` fallback builtin (used when no PATH `ls` is found, e.g. on
146
+ Windows, or under `--builtin-only`) is now `lsfancy` instead of Bun Shell's
147
+ own `ls`, since it now covers more real `ls` behavior (working `-h`/`-t`/
148
+ `-r`, a symlink's target, alphabetical default order) than Bun Shell's
149
+ version does. Bun Shell's `ls` is still reachable, renamed to `lsbun`.
150
+ `lsfancy` itself is unchanged and still callable under its own name.
151
+
152
+ ### Fixed
153
+
154
+ - Fix an unrelated pre-existing hang found while working on the above: a
155
+ pipeline whose downstream stage closes early (`yes | head -n 3`) could
156
+ leave the killed upstream stage's own output-forwarding stuck forever —
157
+ Bun never releases the reader lock it holds on that pipeline link's read
158
+ side once the stage reading it has exited, so a write already in flight
159
+ into it backpressures permanently and cannot be canceled from outside.
160
+ That write is now abandoned instead of waited on once the downstream stage
161
+ is known to be done, and the shell forces its own exit once a script or
162
+ `-c` command finishes rather than leaving that abandoned operation to keep
163
+ the process running forever.
164
+ - Fix `lsfancy -l` showing every file's modification time in UTC instead of
165
+ local time (it built the column from `Date.prototype.toISOString()`, which
166
+ is always UTC) — a pre-existing bug, not something the symlink-target work
167
+ above introduced.
168
+
169
+ ## [0.1.9] - 2026-08-27
170
+
171
+ ### Added
172
+
173
+ - Render Markdown previews in `serve` with heading anchors, passing
174
+ `{ headings: true }` to `Bun.markdown.html`, so long documents get linkable
175
+ section ids.
176
+ - Document `serve` in its own README section, pulled out of the fallback
177
+ builtin table: port selection and its fallback, the `q`/`quit`/`exit` and `o`
178
+ controls, exit codes, directory listings and previews, and the
179
+ non-interactive forms such as `bmsh -cc builtin serve <directory>` that start
180
+ it from another shell or a script.
181
+ - Document packing a folder into a single executable without a source
182
+ checkout — `npx bunmsh --build-exe --asset /absolute/path/mysite`, then
183
+ `bmsh -cc builtin serve 'B:/~BUN/mysite'` — including the absolute-path
184
+ requirement, the PowerShell and `cmd.exe` spellings, and the trade-off
185
+ against the `package.json` `assets` route, which is what makes the same file
186
+ readable through `readAssetText` from a checkout and from the binary.
187
+ - Document that `serve` always answers a directory with its listing rather than
188
+ the directory's `index.html`, and point site hosting at `npx serve` or Bun
189
+ 1.4's `{ dir }` routes, which do send it.
190
+ - Document that HTTP Range is not honoured for files inside a compiled binary:
191
+ Bun answers those with the whole body and a `200`.
192
+
193
+ ## [0.1.8] - 2026-08-27
194
+
195
+ ### Added
196
+
197
+ - Add the `serve [directory]` fallback builtin and standalone `serve.js` as a
198
+ minimal replacement for `python3 -m http.server`. It provides live directory
199
+ listings, reflects filesystem changes, and serves whole `Bun.file` responses
200
+ with Bun's native HTTP Range support.
201
+ - Add `🔍` preview links to `serve` directory pages. Markdown is rendered by
202
+ `Bun.markdown.html`; JSON, JSON5, JSONC, JSONL/NDJSON, YAML, and TOML are
203
+ parsed by their corresponding runtime parser and pretty-printed as HTML.
204
+ XML is also previewed when the running Bun provides `Bun.XML.parse`.
205
+ - Add basic syntax colouring to structured-data previews, following the
206
+ statement, string, escape, number, and constant groups from jsmdcui's
207
+ `runtime/syntax/json.yaml` after parser output is pretty-printed as JSON.
208
+ - Add interactive `serve` controls: `q`, `quit`, and `exit` stop the server,
209
+ while `o` opens its URL through `xdg-open`.
210
+ - Accept both `/$bunfs/...` and `B:/~BUN/...` serve paths on every platform,
211
+ translating either spelling through the compiled module's
212
+ `import.meta.dirname` to the bunfs mount accepted by the current runtime.
213
+
214
+ ### Fixed
215
+
216
+ - Keep `serve` running after malformed preview data or any other uncaught
217
+ request-handler exception; parser failures return 422 and the outer request
218
+ boundary converts unexpected failures to an isolated HTTP 500 response.
219
+ - Prevent Termux foreground/resume terminal resize events from repainting the
220
+ shell's cwd prompt over a running server or other foreground command.
221
+ - Keep the interactive shell alive when Ctrl-C interrupts the prompt or a
222
+ foreground `serve`. Like mksh, SIGINT now abandons the current operation and
223
+ returns to a fresh prompt; Ctrl-D on an empty input remains the way to send
224
+ EOF and leave the shell.
225
+
226
+ ## [0.1.5] - 2026-08-26
227
+
228
+ ### Added
229
+
230
+ - Mark shell-inserted line endings with `↩️`, making the exact boundary of a
231
+ command's output visible when the command does not emit a trailing newline.
232
+ - Document this marker under **Special Interactions → Terminal behavior**.
233
+
234
+ ### Fixed
235
+
236
+ - Preserve the final line of any interactive command whose output has no
237
+ trailing newline, including streamed external commands such as
238
+ `printf hello`. bunmsh now queries the terminal cursor before repainting the
239
+ prompt and only inserts a marked newline when the cursor remains mid-line.
240
+
241
+ ## [0.1.4] - 2026-08-26
242
+
243
+ ### Added
244
+
245
+ - Added `Alt-P` as a second shortcut for `builtin lsfancy ..`, matching
246
+ `Alt-U` and listing the Parent (upper) folder without changing cwd or
247
+ discarding the current edit buffer.
248
+
249
+ ### Fixed
250
+
251
+ - Preserve short `Alt-L`, `Alt-U`, `Alt-P`, and tab-double-click `lsfancy`
252
+ output when readline redraws the prompt. A two-line prompt previously moved
253
+ upward and erased a one-line listing, which was especially visible for the
254
+ parent of the Termux home directory.
255
+ - Derive `HOME` on Windows from `USERPROFILE`, or from `HOMEDRIVE` plus
256
+ `HOMEPATH`, when the environment does not define it. Bare `cd`, `~`, `$HOME`,
257
+ prompt home shortening, and child environments now share a usable home path.
258
+ - Normalise Windows HOME paths to forward slashes and compare HOME/cwd without
259
+ case sensitivity when deciding whether a prompt path should use `~`.
260
+ - Treat Android's `/data/data/PACKAGE` and `/data/user/0/PACKAGE` app-sandbox
261
+ paths as equivalent for prompt home shortening, so Termux HOME and its
262
+ descendants display as `~` even when HOME and cwd use different aliases.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dr. John (醫者小智)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,295 @@
1
+ Terms and Conditions - The MirBSD Korn Shell
2
+ ============================================
3
+
4
+ The MirBSD Korn Shell (mksh) consists of a number of "source" files,
5
+ which are provided by upstream in a number of places. This file will
6
+ list the files belonging to mksh or being part of it and the licence
7
+ terms and conditions that apply to them, in one single central place
8
+ for packagers' convenience. This list aims to be authoritative. (Yet
9
+ as it was compiled by a human, there may be bugs, please report them
10
+ if any are found. We don't think so though.)
11
+
12
+ All paths are relative to The MirOS Project's CVS repository.
13
+
14
+
15
+ The following files form The MirBSD Korn Shell R59-current:
16
+ - build system
17
+ * mksh/Build.sh
18
+ * mksh/FAQ2HTML.sh
19
+ - testsuite driver
20
+ * mksh/check.pl
21
+ - testsuite with code examples
22
+ * mksh/check.t
23
+ - configuration with/and code examples (informal)
24
+ * mksh/dot.mkshrc
25
+ * contrib/hosted/tg/assockit.ksh
26
+ * contrib/hosted/tg/progress-bar
27
+ * contrib/hosted/tg/uhr
28
+ - documentation
29
+ * mksh/lksh.1
30
+ * mksh/mksh.1
31
+ * mksh/mksh.faq
32
+ - source code
33
+ * mksh/edit.c
34
+ * mksh/emacsfn.h
35
+ * mksh/eval.c
36
+ * mksh/exec.c
37
+ * mksh/expr.c
38
+ * mksh/exprtok.h
39
+ * mksh/funcs.c
40
+ * mksh/histrap.c
41
+ * mksh/jehanne.c
42
+ * mksh/jobs.c
43
+ * mksh/lalloc.c
44
+ * mksh/lex.c
45
+ * mksh/main.c
46
+ * mksh/mirhash.h
47
+ * mksh/misc.c
48
+ * mksh/os2.c
49
+ * mksh/rlimits.opt
50
+ * mksh/sh.h
51
+ * mksh/sh_flags.opt
52
+ * mksh/shf.c
53
+ * mksh/syn.c
54
+ * mksh/tree.c
55
+ * mksh/var.c
56
+ * mksh/var_spec.h
57
+ - upstream provided packaging
58
+ * mksh/mksh.ico (application icon resource)
59
+ * mksh/Makefile (MirBSD only, not part of mksh)
60
+ * ports/shells/mksh/DEINSTALL
61
+ * ports/shells/mksh/DESCR (official)
62
+ * ports/shells/mksh/INSTALL
63
+ * ports/shells/mksh/Makefile
64
+ * ports/shells/mksh/PLIST
65
+ * ports/shells/mksh/distinfo (official)
66
+ * src/distrib/special/mksh/Makefile (for the MirBSD installer)
67
+ - website (informal)
68
+ * www/files/TaC-mksh.txt (this file)
69
+ * www/pics/mksh.svg (logo source code)
70
+ * www/pics/mksh128x100.png (logo compiled version)
71
+ * www/src/mksh-faq.hts (supplemental documentation)
72
+ * www/src/mksh.hts (primary webpage)
73
+ * www/src/mksh_bld.hts (supplemental webpage)
74
+ * www/src/mksh_old.hts (supplemental webpage)
75
+
76
+ All of these files are covered by The MirOS Licence (Appendix A) ex-
77
+ cept the application icon resource, the terms for that are listed in
78
+ Appendix D. Width data comes under those in Appendix E.
79
+
80
+ The creator of mksh acknowledges the contributions of several people
81
+ to the Public Domain Korn Shell as well as suggestions and work from
82
+ packagers, other developers etc. and everyone else who helped making
83
+ mksh what it is today. Thanks! The MirBSD Korn Shell is sublicenced
84
+ under a copyright licence fallback from the original pdsh author.
85
+
86
+ The manpage portability glue excerpts from the UCB mdoc package, for
87
+ interoperability patching; see Appendix B for terms of cited parts.
88
+
89
+
90
+ The following files belong to mksh and are distributed inside of its
91
+ distfile, but are not part of it. They are provided for convenience,
92
+ because they are required on many operating environments for mksh or
93
+ some of its features to function:
94
+ - source code
95
+ * mksh/strlcpy.c (needed if not provided by the OS already)
96
+
97
+ These files are covered by seperate licences in addition (Appendix C
98
+ for now). Some operating environments already provide their functio-
99
+ nality, such as the BSDs and OSX libc, or the Debian/freedesktop.org
100
+ libbsd package. The files are not compiled into the resulting binary
101
+ if their respective functionality is already provided.
102
+
103
+
104
+ The following file is not part of mksh but can be used with it; it's
105
+ also not included in the mksh distfile:
106
+ - source code
107
+ * src/usr.bin/printf/printf.c (UCB printf(1) utility that has been
108
+ slightly modified, for an optional built-in printf, to be inclu-
109
+ ded for lksh-as-/bin/sh only and only when necessary)
110
+
111
+ The printf.c file is covered by the UCB three-clause BSD licence, as
112
+ shown in Appendix B below.
113
+
114
+
115
+ The MirOS Licence also applies as a collective-work copyright on The
116
+ MirBSD Korn Shell, an authorised derivate of the 1980s Public Domain
117
+ V7/Bourne Shell.
118
+
119
+ Note that these appendices may represent the terms and conditions of
120
+ more than one file, hence the actual wording of the files was folded
121
+ into one representation, with different copyright holders and years,
122
+ separated if merging was undesirable.
123
+
124
+
125
+ Appendix A - The MirOS Licence (OSI approved)
126
+ ==============================
127
+
128
+ The MirBSD Korn Shell (mksh) is
129
+ Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
130
+ 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
131
+ 2020, 2021, 2022, 2023, 2024, 2025, 2026
132
+ mirabilos <m$(date +%Y)@mirbsd.de>
133
+ Copyright (c) 2015, 2017, 2020
134
+ KO Myung-Hun <komh@chollian.net>
135
+ Copyright (c) 2015
136
+ Daniel Richard G. <skunk@iSKUNK.ORG>
137
+ Copyright (c) 2017
138
+ Giacomo Tesio <giacomo@tesio.it>
139
+ All rights reserved.
140
+
141
+ The mksh logo is
142
+ Copyright (c) 2008, 2009
143
+ Lukas U. <smultron@midnightbsd.org>
144
+ Copyright (c) 2008, 2009
145
+ mirabilos <m$(date +%Y)@mirbsd.de>
146
+
147
+
148
+ Provided that these terms and disclaimer and all copyright notices
149
+ are retained or reproduced in an accompanying document, permission
150
+ is granted to deal in this work without restriction, including un-
151
+ limited rights to use, publicly perform, distribute, sell, modify,
152
+ merge, give away, or sublicence.
153
+
154
+ This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
155
+ the utmost extent permitted by applicable law, neither express nor
156
+ implied; without malicious intent or gross negligence. In no event
157
+ may a licensor, author or contributor be held liable for indirect,
158
+ direct, other damage, loss, or other issues arising in any way out
159
+ of dealing in the work, even if advised of the possibility of such
160
+ damage or existence of a defect, except proven that it results out
161
+ of said person's immediate fault when using the work as intended.
162
+
163
+
164
+ Appendix B - The UCB (3-clause BSD) licence (OSI approved)
165
+ ===========================================
166
+
167
+ GNU groff portability glue in the manual page source is
168
+ Copyright (c) 1991, 1993
169
+ The Regents of the University of California.
170
+ printf.c is
171
+ Copyright (c) 1989
172
+ The Regents of the University of California.
173
+ All rights reserved.
174
+
175
+
176
+ Redistribution and use in source and binary forms, with or without
177
+ modification, are permitted provided that the following conditions
178
+ are met:
179
+ 1. Redistributions of source code must retain the above copyright
180
+ notice, this list of conditions and the following disclaimer.
181
+ 2. Redistributions in binary form must reproduce the above copyright
182
+ notice, this list of conditions and the following disclaimer in the
183
+ documentation and/or other materials provided with the distribution.
184
+ 3. Neither the name of the University nor the names of its contributors
185
+ may be used to endorse or promote products derived from this software
186
+ without specific prior written permission.
187
+
188
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
189
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
190
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
192
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
193
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
194
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
195
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
196
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
197
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
198
+ SUCH DAMAGE.
199
+
200
+
201
+ Appendix C - ISC Licence (OSI approved)
202
+ ========================
203
+
204
+ strlcpy.c is
205
+ Copyright (c) 2006, 2008, 2009, 2013
206
+ mirabilos <m$(date +%Y)@mirbsd.de>
207
+ Copyright (c) 1998
208
+ Todd C. Miller <Todd.Miller@courtesan.com>
209
+
210
+
211
+ Permission to use, copy, modify, and distribute this software for any
212
+ purpose with or without fee is hereby granted, provided that the above
213
+ copyright notice and this permission notice appear in all copies.
214
+
215
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
216
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
217
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
218
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
219
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
220
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
221
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
222
+
223
+
224
+ Appendix D - Licence for mksh.ico (optional component)
225
+ =================================
226
+
227
+ The application icon resource comes in its preferred form
228
+ of modification and is an unregistered trademark:
229
+
230
+ Copyright (c) 2013 Michael Langguth <mail@michael-langguth.de>
231
+ Copyright (c) 2006 Benny Siegert
232
+ Copyright (c) 2005 mirabilos
233
+
234
+ This icon may be used to refer to The MirBSD Korn Shell and
235
+ its Win32 port. Distribution patches are acceptable as long
236
+ as they modify $KSH_VERSION according to the guidelines that
237
+ are published on the website; forks and works that are not
238
+ derivates are not allowed to use it.
239
+
240
+ As far as MirBSD is concerned, the files themselves are free
241
+ to modification and distribution under BSD/MirOS Licence, the
242
+ restriction on use stems only from a need to protect it or
243
+ lose it: http://www.mckusick.com/beastie/mainpage/copyright.html
244
+
245
+ The Shilouette daemon is Copyright (c) 2003 by Rick Collette.
246
+ The MirOS Project may freely use the former ekkoBSD Logo,
247
+ the shilouette Daemon, for MirBSD, on anything the project
248
+ leader sees fit, so long as it pertains to MirBSD in some
249
+ way and the leader gives credit for the original daemon to
250
+ Marshall Kirk McKusick.
251
+
252
+ The BSD daemon is Copyright (c) 1988 by Marshall Kirk McKusick.
253
+ All Rights Reserved. Individuals may use the daemon for their
254
+ personal use within the bounds of good taste. When reasonably
255
+ possible, the text shown above is to be included.
256
+
257
+
258
+ Appendix E - Unicode Data Files and Software Licence
259
+ ====================================================
260
+
261
+ Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.
262
+ Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
263
+
264
+ Permission is hereby granted, free of charge, to any person obtaining
265
+ a copy of the Unicode data files and any associated documentation
266
+ (the "Data Files") or Unicode software and any associated documentation
267
+ (the "Software") to deal in the Data Files or Software
268
+ without restriction, including without limitation the rights to use,
269
+ copy, modify, merge, publish, distribute, and/or sell copies of
270
+ the Data Files or Software, and to permit persons to whom the Data Files
271
+ or Software are furnished to do so, provided that either
272
+ (a) this copyright and permission notice appear with all copies
273
+ of the Data Files or Software, or
274
+ (b) this copyright and permission notice appear in associated
275
+ Documentation.
276
+
277
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
278
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
279
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
280
+ NONINFRINGEMENT OF THIRD PARTY RIGHTS.
281
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
282
+ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
283
+ DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
284
+ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
285
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
286
+ PERFORMANCE OF THE DATA FILES OR SOFTWARE.
287
+
288
+ Except as contained in this notice, the name of a copyright holder
289
+ shall not be used in advertising or otherwise to promote the sale,
290
+ use or other dealings in these Data Files or Software without prior
291
+ written authorization of the copyright holder.
292
+
293
+
294
+ __________________________________________________________________
295
+ $MirOS: www/files/TaC-mksh.txt,v 1.40 2026/01/25 06:48:29 tg Exp $