buninu 0.4.9 → 0.4.10
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/CHANGELOG.md +12 -0
- package/README.md +4 -0
- package/apps/bunmsh/CHANGELOG.md +12 -0
- package/apps/bunmsh/package.json +1 -1
- package/apps/bunmsh/src/shell.js +31 -5
- package/apps/bunmsh/test/shell1.test.js +23 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.10 - 2026-09-20
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Sync bunmsh to 0.3.7. Its fallback `tr` builtin now decodes NUL, octal and
|
|
8
|
+
common backslash escapes in character sets, so commands such as
|
|
9
|
+
`tr '\0' '\n' < /proc/$$/cmdline` correctly split NUL-delimited process
|
|
10
|
+
arguments. Previously the NUL bytes passed through unchanged; the Buninu
|
|
11
|
+
multicall launcher could then misidentify a command invoked with arguments
|
|
12
|
+
and exit with status 127 before reaching its shell wrapper, for example
|
|
13
|
+
`jmi hlw.js` even though plain `jmi` worked.
|
|
14
|
+
|
|
3
15
|
## 0.4.9 - 2026-09-16
|
|
4
16
|
|
|
5
17
|
### Changed
|
package/README.md
CHANGED
|
@@ -336,6 +336,8 @@ for how it works):
|
|
|
336
336
|
- **Editing and viewing**
|
|
337
337
|
* `jmi` — Edit files in the js micro editor
|
|
338
338
|
* `glow` — View file contents with syntax highlighting
|
|
339
|
+
* `bun pm diff ./dir1 ./dir2` — diff 2 folders
|
|
340
|
+
+ Can also diff against npm registry packages
|
|
339
341
|
|
|
340
342
|
---
|
|
341
343
|
|
|
@@ -564,6 +566,8 @@ Neither is distributed with Buninu.
|
|
|
564
566
|
|
|
565
567
|
- `bunproot --git clone` should be cross-platform
|
|
566
568
|
* Tested on Android, Linux, and Windows
|
|
569
|
+
* If git clone fails, try `bun pm cache rm`
|
|
570
|
+
* This `bunproot --git` also supports many other subcommands. Show them by `--git --help`
|
|
567
571
|
- The container example below is Android-only.
|
|
568
572
|
|
|
569
573
|
```sh
|
package/apps/bunmsh/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable user-visible changes to bunmsh are documented here.
|
|
4
4
|
|
|
5
|
+
## [0.3.7] - 2026-09-20
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Teach the fallback `tr` builtin to decode NUL, octal, and the common
|
|
10
|
+
backslash escapes in its character sets. Commands such as
|
|
11
|
+
`tr '\0' '\n' < /proc/$$/cmdline` now translate NUL-delimited input instead
|
|
12
|
+
of passing the NUL bytes through unchanged; `tr -d '\000'` works as well.
|
|
13
|
+
Range expansion such as `tr a-z A-Z` remains supported, and regression
|
|
14
|
+
tests cover both translating and deleting NUL bytes from general binary
|
|
15
|
+
input.
|
|
16
|
+
|
|
5
17
|
## [0.3.6] - 2026-09-15
|
|
6
18
|
|
|
7
19
|
### Added
|
package/apps/bunmsh/package.json
CHANGED
package/apps/bunmsh/src/shell.js
CHANGED
|
@@ -1898,11 +1898,37 @@ async function runWcFallback(argv, state, input) {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
1900
1900
|
function expandTrSet(value) {
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1901
|
+
const escapes = { a: "\x07", b: "\b", f: "\f", n: "\n", r: "\r", t: "\t", v: "\v", "\\": "\\" };
|
|
1902
|
+
const characters = [];
|
|
1903
|
+
for (let i = 0; i < value.length; i++) {
|
|
1904
|
+
if (value[i] !== "\\") {
|
|
1905
|
+
characters.push(value[i]);
|
|
1906
|
+
continue;
|
|
1907
|
+
}
|
|
1908
|
+
const octal = value.slice(i + 1).match(/^[0-7]{1,3}/)?.[0];
|
|
1909
|
+
if (octal) {
|
|
1910
|
+
characters.push(String.fromCharCode(Number.parseInt(octal, 8)));
|
|
1911
|
+
i += octal.length;
|
|
1912
|
+
continue;
|
|
1913
|
+
}
|
|
1914
|
+
const escaped = value[++i];
|
|
1915
|
+
characters.push(escapes[escaped] ?? escaped ?? "\\");
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
let output = "";
|
|
1919
|
+
for (let i = 0; i < characters.length; i++) {
|
|
1920
|
+
if (i + 2 < characters.length && characters[i + 1] === "-") {
|
|
1921
|
+
const first = characters[i].charCodeAt(0);
|
|
1922
|
+
const last = characters[i + 2].charCodeAt(0);
|
|
1923
|
+
if (first <= last) {
|
|
1924
|
+
for (let code = first; code <= last; code++) output += String.fromCharCode(code);
|
|
1925
|
+
i += 2;
|
|
1926
|
+
continue;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
output += characters[i];
|
|
1930
|
+
}
|
|
1931
|
+
return output;
|
|
1906
1932
|
}
|
|
1907
1933
|
|
|
1908
1934
|
async function runTrFallback(argv, _state, input) {
|
|
@@ -381,6 +381,29 @@ describe("execution", () => {
|
|
|
381
381
|
expect(await run("builtin sleep 1ms")).toMatchObject({ status: 0, stdout: "", stderr: "" });
|
|
382
382
|
});
|
|
383
383
|
|
|
384
|
+
test("tr translates and deletes NUL bytes", async () => {
|
|
385
|
+
const directory = mkdtempSync(join(tmpdir(), "bunmsh-tr-"));
|
|
386
|
+
const cmdline = join(directory, "cmdline");
|
|
387
|
+
try {
|
|
388
|
+
await Bun.write(cmdline, new Uint8Array([
|
|
389
|
+
...new TextEncoder().encode("/buninu/bin/jmi"), 0,
|
|
390
|
+
...new TextEncoder().encode("hlw.js"), 0,
|
|
391
|
+
]));
|
|
392
|
+
expect(await run(`builtin tr '\\0' '\\n' < '${cmdline}'`)).toMatchObject({
|
|
393
|
+
status: 0,
|
|
394
|
+
stdout: "/buninu/bin/jmi\nhlw.js\n",
|
|
395
|
+
stderr: "",
|
|
396
|
+
});
|
|
397
|
+
expect(await run(`builtin tr -d '\\000' < '${cmdline}'`)).toMatchObject({
|
|
398
|
+
status: 0,
|
|
399
|
+
stdout: "/buninu/bin/jmihlw.js",
|
|
400
|
+
stderr: "",
|
|
401
|
+
});
|
|
402
|
+
} finally {
|
|
403
|
+
rmSync(directory, { recursive: true, force: true });
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
|
|
384
407
|
test("renders asset-backed Markdown help for every documented builtin", async () => {
|
|
385
408
|
const excluded = new Set([".", "..", "//", "-", "~"]);
|
|
386
409
|
const titles = { "[": "test", __builtin: "builtin", chdir: "cd" };
|
|
@@ -1062,4 +1085,3 @@ fi
|
|
|
1062
1085
|
} finally { rmSync(home, { recursive: true, force: true }); }
|
|
1063
1086
|
});
|
|
1064
1087
|
});
|
|
1065
|
-
|
package/package.json
CHANGED