buninu 0.4.1 → 0.4.3

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.2 - 2026-09-03
4
+
5
+ ### Changed
6
+
7
+ - Update the bundled bunmsh from 0.2.0 to 0.3.3, which is what a `--local`
8
+ session runs. It gains a `curl` PATH-fallback builtin written on Bun's own
9
+ `fetch`, so a device that ships no `curl` binary can still run the download
10
+ and API scripts that expect one; `pspa` and `pspac`, the process listing this
11
+ tree's `.bashrc` aliases used to be the only way to get; and a `kill` that
12
+ works on Windows. Its JavaScript mode binds `$` to the shell's own variable
13
+ table, so `$.HOME` reads a shell variable and `$.TAG = "v1"` writes one that
14
+ later commands see, and completion learned shell variable names, command
15
+ names inside `$(`, and JavaScript lines. A real `curl`, `pspa` or `pspac` in
16
+ `PATH` still wins over any of the builtins; `builtin curl ...` selects
17
+ bunmsh's. Its own [CHANGELOG](apps/bunmsh/CHANGELOG.md) has the rest.
18
+
19
+ ### Fixed
20
+
21
+ - The process-list helpers section, left behind by the bunmsh update above,
22
+ still described `--local` as a session with neither the bundled `.bashrc` nor
23
+ `$HOME/.bashrc`, and sent you to source the bundled file to get the aliases
24
+ back — where `pspac`, being two commands joined by `;`, would fail to define
25
+ as a bunmsh alias. bunmsh now has `pspa` and `pspac` as PATH-fallback
26
+ builtins, and colour aliases for `ls`, `grep` and `diff` of its own, so a
27
+ `--local` session already answers all five of those names and has no reason
28
+ to source anything. The section says so now, and says where the builtins
29
+ differ from the aliases they stand in for: `pspac` colours the table inline
30
+ rather than writing `$HOME/.pspidargs.sh` and paging it through `glow`, and
31
+ `pspa` answers on Windows as well, by querying `Win32_Process` through
32
+ PowerShell, where `ps -eo pid,args` has no counterpart — so the paragraph
33
+ ruling Windows out is now about the aliases rather than about both. Nothing
34
+ changed for the other routes: Android still loads the bundled file through
35
+ `ENV` for the shell jsgotty starts, and a remote Bash or mksh session on
36
+ Linux or macOS still sources it by hand.
37
+
3
38
  ## 0.4.1 - 2026-08-30
4
39
 
5
40
  ### Fixed
package/README.md CHANGED
@@ -112,8 +112,8 @@ bun ~/somewhere/buninu/bin/init.js --local
112
112
  ```
113
113
 
114
114
  Command history is kept in your own home directory either way, so it survives
115
- `npx`. What does not is anything you add to the installation itself — aliases
116
- in its `.bashrc`, commands of your own under `apps/` — since that lives in the
115
+ `npx`. What does not is anything you add to the installation itself — commands
116
+ of your own under `apps/`, edits to its `.bashrc` — since that lives in the
117
117
  package, and under `npx` the package is a cache directory.
118
118
  See [Data & Persistence](#data--persistence).
119
119
 
@@ -126,6 +126,26 @@ bun ./bin/init.js --local
126
126
  Buninu's own tools (`rz`, `sz`, `showimg`, `tts`, `xdg-open`, `native-bridge`,
127
127
  etc.) stay available inside this shell too, same as in the browser session.
128
128
 
129
+ Unlike the shells the browser terminal starts, **bunmsh does not read
130
+ `.bashrc`**. It does not claim complete POSIX behavior yet, so a startup file
131
+ written for a full shell can fail part way through — and a startup file that
132
+ fails is a shell you cannot get into. Nothing is read automatically until that
133
+ is no longer a risk. Source it yourself when you want it:
134
+
135
+ ```sh
136
+ . ./.bashrc
137
+ ```
138
+
139
+ The shell starts in `BUNINU_HOME`, so that path works as written at first;
140
+ after moving elsewhere, use `. "$BUNINU_HOME/.bashrc"`.
141
+
142
+ There is no setting that does this for you yet, and
143
+ [`buninu.command`](#startup-command-optional) is not it:
144
+ `--local` does not run it at all, and the browser terminal, which does, runs it
145
+ in a subshell before starting a fresh shell — so aliases and functions a
146
+ startup command defines are gone by the time you reach a prompt either way.
147
+ Until bunmsh reads a startup file of its own, sourcing it by hand is the way.
148
+
129
149
  ## Data & Persistence
130
150
 
131
151
  Running Buninu via `npx` works like a container: `npx` fetches the package into
@@ -624,6 +644,16 @@ terminal returns to an interactive shell.
624
644
  For compatibility, `"command": "..."` is also accepted as a shared command
625
645
  for every platform.
626
646
 
647
+ The command runs in a subshell, and the interactive shell that follows is a
648
+ fresh one, so anything it defines rather than does — aliases, functions, shell
649
+ variables — is gone before you reach a prompt. Use it to run something, print
650
+ something, or start something; a startup file that configures the session is a
651
+ job for the shell itself, through `ENV` for the shells that honor it.
652
+
653
+ It applies to the browser terminal only. `--local` does not run it, so a
654
+ `bunmsh` session starts with nothing from this setting; see
655
+ [Start a local shell in a Terminal](#start-a-local-shell-in-a-terminal-experimental).
656
+
627
657
  Override it for one run with:
628
658
 
629
659
  ```sh
@@ -728,6 +758,57 @@ in a way that leaves the back key broken.
728
758
  The bundled `.bashrc` provides `pspa` (`ps -eo pid,args`) and `pspac`, which
729
759
  writes that process list to `$HOME/.pspidargs.sh` and displays it with `glow`.
730
760
  Buninu preserves an existing `HOME` rather than replacing or modifying the
731
- user's home; shells that honor `ENV` load the bundled file, while interactive
732
- Bash may load only `$HOME/.bashrc`, so add `. "$BUNINU_HOME/.bashrc"` to a
733
- custom Bash configuration when these aliases are not available.
761
+ user's home, and points `ENV` at the bundled file. Whether that file is read
762
+ depends entirely on the shell:
763
+
764
+ | Where | Shell | The bundled `.bashrc` |
765
+ |---|---|---|
766
+ | Android, including a minapk APK | `/system/bin/sh`, which is mksh | Loaded through `ENV`; all of these aliases work |
767
+ | Linux and macOS | Bash, usually | Not loaded — an interactive Bash reads `$HOME/.bashrc` and ignores `ENV` |
768
+ | Windows | PowerShell, or `cmd.exe` | Not loaded, and these aliases would not carry over: listing processes is spelled differently there |
769
+ | `--local` | bunmsh | Not loaded, and not needed: bunmsh answers all five names itself |
770
+
771
+ So Android gets these aliases without doing anything, and everywhere else the
772
+ bundled file sits unread — which also means your own `$HOME/.bashrc` is left
773
+ entirely alone.
774
+
775
+ Under `--local` these are bunmsh's own, not aliases read from a file, so they
776
+ work with nothing sourced — and the two process helpers are not quite the same
777
+ two commands. `pspa` prints the same PID-and-command-line table, but through
778
+ bunmsh's own process query, which also answers on Windows, where
779
+ `ps -eo pid,args` has no counterpart. `pspac` colours that table inline as
780
+ shell syntax: it writes no `$HOME/.pspidargs.sh` and does not need `glow`.
781
+ Both are PATH-fallback builtins, so a real `pspa` or `pspac` on `PATH` still
782
+ wins and `builtin pspa` selects bunmsh's explicitly. Its `ls`, `grep` and
783
+ `diff` colour aliases are built in as well, which is why nothing in the bundled
784
+ file is missing from a `--local` session. See
785
+ [bunmsh's PATH-fallback builtins](apps/bunmsh/README.md#path-fallback-builtins).
786
+
787
+ On Windows the two *aliases* do not apply. Both wrap `ps -eo pid,args`, and
788
+ that invocation has no counterpart: PowerShell does have `ps`, but as an alias
789
+ for `Get-Process`, which takes its own options rather than those. List
790
+ processes with `Get-Process` in PowerShell, or `tasklist` in `cmd.exe` — or use
791
+ `--local`, where bunmsh's builtins of the same names answer by querying
792
+ `Win32_Process` through PowerShell and print the same two columns.
793
+
794
+ To get the aliases in a POSIX session that did not load them, source the file
795
+ from the prompt:
796
+
797
+ ```sh
798
+ . "$BUNINU_HOME/.bashrc"
799
+ ```
800
+
801
+ Source it from the prompt rather than putting that line in your own
802
+ `$HOME/.bashrc`: `BUNINU_HOME` is only set inside a Buninu session, so
803
+ elsewhere the same line reads `. "/.bashrc"` and every shell you open either
804
+ complains or, if that file happens to exist, sources something you did not
805
+ mean to.
806
+
807
+ That is for a Bash or mksh session that did not load the file — the remote
808
+ route on Linux and macOS. A `--local` session has no reason to source it, since
809
+ bunmsh defines all five names itself. Sourcing it there anyway still reports
810
+ `alias: pspac: invalid alias` and carries on: a bunmsh alias is a list of
811
+ words, and `pspac` is two commands joined by `;` with a redirection in the
812
+ first, so it cannot be one — but the builtin of that name is already there, and
813
+ an alias that fails to define leaves it reachable. See
814
+ [Start a local shell in a Terminal](#start-a-local-shell-in-a-terminal-experimental).
@@ -2,6 +2,182 @@
2
2
 
3
3
  All notable user-visible changes to bunmsh are documented here.
4
4
 
5
+ ## [0.3.3] - 2026-09-03
6
+
7
+ ### Fixed
8
+
9
+ - Pass `--color` rather than `--color=auto` in the default `diff` alias.
10
+ Toybox's `diff` — the one Android answers `/system/bin/diff` with — spells
11
+ the option without a `=WHEN` argument and rejects the longer form outright
12
+ (`diff: Unknown option 'color=auto'`, status 2), so an unqualified `diff`
13
+ produced an error instead of a comparison. GNU diffutils accepts either
14
+ spelling, so nothing changes where that is the `diff` on `PATH`. The `ls` and
15
+ `grep` aliases keep `--color=auto`, which both of those do accept.
16
+
17
+ BusyBox `diff` has no colour option under either spelling and answers
18
+ `diff: unrecognized option: color`. Override the alias with `alias diff=diff`
19
+ where `diff` is BusyBox, as it is on Alpine.
20
+
21
+ ## [0.3.2] - 2026-09-01
22
+
23
+ ### Added
24
+
25
+ - Bind `$` to the shell's variable table inside the highest-priority
26
+ JavaScript mode, so the two languages share one set of variables rather than
27
+ passing strings across a boundary. `Bun.e, $.HOME` reads one — exported or
28
+ not — `$.TAG = "v1"` writes one that later shell commands and external child
29
+ processes both see, `delete $.NAME` unsets one, and `Object.keys($)`
30
+ enumerates them. It is the live table rather than a copy, which is what makes
31
+ a write visible immediately; it also means a write bypasses `readonly`, so
32
+ `$` is an escape hatch as much as a convenience. Bun Shell's own `Bun.$` is
33
+ reached through the `Bun` object and is unaffected by the binding. Values
34
+ are shell values, so they are strings: `$.X + 1` concatenates unless
35
+ converted, and assigning a non-string stores it as-is, leaving JavaScript
36
+ with a number under that name while every name the shell set stays a string.
37
+ The README says so with examples.
38
+
39
+ - Complete shell variable names. Typing `$HO` now ghosts `$HOME` and Tab
40
+ offers every matching name; `${HO` completes to `${HOME}`, closing the brace
41
+ it opened, and `${#HO` does the same. Names come from the shell's own
42
+ variable table, so unexported names — and anything JavaScript mode wrote
43
+ through `$` — are offered alongside the environment. It applies wherever an
44
+ expansion would happen (mid-word, after `X=`, inside double quotes, and in
45
+ command position), stays quiet inside single quotes, and is not offered for
46
+ the other things a `$` can start: `$(`, `$?`, `$1`, `$$`, and a
47
+ backslash-escaped `\$` (the backslashes are counted, so `\\$HO` still
48
+ suggests). A bare `$` ghosts nothing but still lists everything on Tab, the
49
+ way an empty word lists every file. Where both apply, the history ghost still
50
+ wins, since it completes the whole line.
51
+ - Complete command names inside `$(`. A command substitution starts a new
52
+ command, but the completer used to read `$(l` as one long word and look for
53
+ a file by that name; it now offers commands there, and files after the
54
+ command, the way it does at the start of a line.
55
+
56
+ - Complete on a JavaScript line too, reading it as JavaScript rather than as
57
+ shell text. After `$.` it offers shell variable names, and inside an unclosed
58
+ string literal it completes the text back to the opening quote as a path —
59
+ so `Bun.file("/tm` completes without the trailing space that used to be
60
+ needed to make the completer see a path at all, and without trimming that
61
+ space back off afterwards. A template's `${...}` counts as code again, so
62
+ `$.` completes inside it. A bare `$` completes nothing there, since in
63
+ JavaScript it is the variable table itself and a name only begins after the
64
+ dot. Where neither applies only the history ghost is offered.
65
+
66
+ ### Fixed
67
+
68
+ - Stop asking a JavaScript line to continue when it cannot. A line ending in a
69
+ bare backslash used to get the shell's PS2 prompt, but a backslash outside a
70
+ string literal is a syntax error in JavaScript, so whatever was typed next
71
+ was guaranteed not to parse. An unterminated string or template still
72
+ continues, because that is JavaScript's own line continuation and the
73
+ evaluator does accept it — `Bun.e, "abc\` and `def"` on two lines prints
74
+ `abcdef`. The rule that decides JavaScript mode is now one exported
75
+ function, so the prompt, the completer and the evaluator cannot disagree
76
+ about what a line is.
77
+
78
+ ## [0.3.1] - 2026-09-01
79
+
80
+ ### Added
81
+
82
+ - Ship `LICENSE`, `LICENSE-MKSH`, and `LICENSE-MICRO` as packaged assets, so
83
+ a standalone executable carries them the way it already carried the README
84
+ and this changelog. It matters for `LICENSE-MICRO` in particular: the binary
85
+ contains the highlighting rules transcribed from micro's
86
+ `runtime/syntax/sh.yaml`, and an MIT notice has to travel with the code it
87
+ covers, not only with the repository. Reading them back out of a build is
88
+ `--assets-extract` on the tar back end, or `builtin serve 'B:/~BUN'` on an
89
+ `ASSETS_BUNFS=1` one; both land the licences under
90
+ `assets/bunmsh@<version>/`, and the README's licence section says so.
91
+
92
+ ### Changed
93
+
94
+ - Say plainly in the README and in `LICENSE-MICRO` that `catfancy` takes five
95
+ of micro's `monokai.micro` colour-links for its JSON, rather than only that
96
+ its colours happen to be the same five values. The palette was taken from
97
+ micro, so the attribution now says so.
98
+
99
+ ## [0.3.0] - 2026-09-01
100
+
101
+ ### Added
102
+
103
+ - Add a `curl` PATH-fallback builtin implemented on Bun's own `fetch`, so a
104
+ device that ships no `curl` binary can still run the download and API
105
+ scripts that expect one. A real `curl` in `PATH` still wins;
106
+ `builtin curl ...` selects this one. A URL with no scheme gets one —
107
+ `http://`, or `https://` when the port is `443`, or whatever
108
+ `--proto-default` names — so `curl localhost:8080` and `curl example.com`
109
+ behave the way they do with the real curl.
110
+ - Downloads: `-o`, `-O`, `-J`, `--output-dir`, `--create-dirs`, `-a`, and
111
+ `-C -`/`-C OFFSET` resume, which sizes the partial file, asks for the rest
112
+ with a `Range` header, appends when the server answers `206`, rewrites when
113
+ a `200` says the range was ignored, and treats `416` as "already complete".
114
+ - Request bodies: `-X`, `-H` (including curl's `'Name;'` empty-value and
115
+ `'Name:'` removal forms), `-d`, `--data-raw`, `--data-binary`,
116
+ `--data-ascii`, `--data-urlencode`, `--json`, `-G`, `-F`,
117
+ `--form-string`, `-T`, `-u`, `--oauth2-bearer`, `-A`, `-e`, `-b`, `-r`,
118
+ `--compressed`, and `-x`, with `@file` and `@-` reading a body from a file
119
+ or from stdin — enough to call a JSON API such as OpenAI's chat
120
+ completions endpoint from the shell.
121
+ - Responses and reporting: `-i`, `-I`, `-D`, `-w` with the usual
122
+ `%{variable}` set, `-L` with `--max-redirs` and the `301`/`302`/`303`
123
+ POST-to-GET rule, `-f`, `--fail-with-body`, `-k`, `-m`,
124
+ `--connect-timeout`, `--retry` and friends, `-s`, `-S`, `-v`, `-#`, and a
125
+ curl-shaped progress meter that appears only when the body is not being
126
+ painted on the terminal. curl's exit codes are reproduced, including `22`,
127
+ `6`, `7`, `28`, `47`, `60`, and `2`.
128
+ - Short clusters parse the way curl's do, so the invocations packaging
129
+ scripts use — `-kLO`, `-C - -kLO`, `-fsSL`, `-kfsS`, `-#k` — work
130
+ unchanged. TLS-material and connection-tuning options (`--cacert`,
131
+ `--cert`, `--interface`, `--limit-rate`, `-4`, `--http2`, and the rest)
132
+ are parsed and then ignored so a script does not die on them.
133
+ - Bodies stream, so `curl -N` on a server-sent-events endpoint prints each
134
+ chunk as it arrives and a large download never buffers in memory.
135
+ - `test/reference.test.js` compares the builtin against the system `curl`
136
+ over a local server: bodies, exit codes, redirect handling, request bodies,
137
+ and `--write-out` output are byte-for-byte identical, and `-i` matches once
138
+ header order and casing — which `fetch` does not preserve — are normalised.
139
+
140
+ - Add a `pspa` PATH-fallback builtin that lists every process as a PID and its
141
+ full command line, so a device with no process viewer still has one. POSIX
142
+ runs `ps -eo pid,args` and passes its output through untouched — reading it
143
+ over a pipe is also what stops procps from cutting long command lines at the
144
+ terminal width. Windows, which has no `ps`, queries `Win32_Process` through
145
+ PowerShell and lays the same two columns out itself, using the image name
146
+ for a system process that reports no command line. It takes no options; pipe
147
+ it into `grep` to narrow the listing and into `kill` to act on it.
148
+ - Add `pspac`, the same process listing with the PID and the command line
149
+ coloured. The COMMAND column is a shell command line, so it is highlighted
150
+ as one, following micro's `syntax/sh.yaml` rules and its
151
+ `colorschemes/monokai.micro` colour-links — the palette `catfancy` already
152
+ uses — down to its region handling (a `#` inside a quoted argument does not
153
+ open a comment) and its rule precedence (`--cat` is a flag, not the
154
+ coreutils `cat`). Two things a listing needs that a script does not: the
155
+ directory in front of the program is dimmed, and the program's own name is
156
+ coloured as a command whether or not sh.yaml's word lists have heard of it.
157
+ Like `catfancy` it always colours; strip the colour from its output and
158
+ `pspa`'s is what remains, which is what its tests assert.
159
+ - Add `LICENSE-MICRO` and a "Syntax highlighting" section under the README's
160
+ licence heading, covering what the colouring inherits from
161
+ [micro](https://github.com/zyedidia/micro): `pspac` transcribes the rules of
162
+ its `runtime/syntax/sh.yaml` (MIT "Expat", Copyright (c) 2020: Zachary
163
+ Yedidia, et al.), and both `pspac` and `catfancy` paint with the
164
+ colour-links of its `runtime/colorschemes/monokai.micro` (micro itself: MIT,
165
+ Copyright (c) 2016-2020: Zachary Yedidia, et al.), which renders Wimer
166
+ Hazenberg's Monokai palette. No micro file is bundled, but the rules are
167
+ transcribed from one, so the licence notice ships with them.
168
+
169
+ ### Fixed
170
+
171
+ - Make `kill` work on Windows. It went through the runtime's `process.kill`,
172
+ which there turns SIGTERM, SIGINT, and SIGKILL into an unconditional
173
+ `TerminateProcess`, refuses every other signal name outright, and in no case
174
+ reaches the target's children. A terminating signal is now sent as
175
+ `taskkill /PID PID /T /F` — the form bun-taskmgr verified on Windows 11 —
176
+ so every signal name works and a process tree goes down with its root. The
177
+ name is still not honoured as a signal, because Windows has none to deliver;
178
+ `-0` continues to probe through the runtime, since `taskkill` has no way to
179
+ ask whether a PID exists without killing it.
180
+
5
181
  ## [0.2.0] - 2026-08-29
6
182
 
7
183
  ### Added
@@ -0,0 +1,58 @@
1
+ Terms and Conditions - micro syntax rules and colour scheme
2
+ ===========================================================
3
+
4
+ bunmsh does not bundle any file from micro, the Go terminal editor at
5
+ https://github.com/zyedidia/micro. What it derives from micro is:
6
+
7
+ * The shell-syntax highlighting rules `pspac` applies to the COMMAND column
8
+ of its process listing. The patterns and word lists of micro's
9
+ `runtime/syntax/sh.yaml` — keywords, command names, flags, variables,
10
+ strings, comments — and the order they resolve in were transcribed into
11
+ `src/shell.js`.
12
+
13
+ * The colours those classes are painted in, which are the colour-links of
14
+ micro's `runtime/colorschemes/monokai.micro`, transcribed into the same
15
+ file. `src/cat-fancy.js` takes five of the same colour-links for the
16
+ JSON it colours.
17
+
18
+ Both come from micro's own tree — `runtime/syntax/sh.yaml` and
19
+ `runtime/colorschemes/monokai.micro` — and that is where to trace this
20
+ licence from: `runtime/syntax/LICENSE` and `LICENSE` in
21
+ https://github.com/zyedidia/micro.
22
+
23
+ Micro's syntax files are licensed under the MIT "Expat" License:
24
+
25
+ Copyright (c) 2020: Zachary Yedidia, et al.
26
+
27
+ Micro itself, which its colour schemes are part of, carries the same licence:
28
+
29
+ Copyright (c) 2016-2020: Zachary Yedidia, et al.
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ "Software"), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49
+
50
+ Further attribution
51
+ -------------------
52
+
53
+ micro's `runtime/syntax/README.md` records that its syntax files originate
54
+ from Nano's `nanorc` collection (https://github.com/scopatz/nanorc), converted
55
+ to micro's own format.
56
+
57
+ The Monokai palette that `monokai.micro` renders was created by Wimer
58
+ Hazenberg.