brsh 2.5.1 → 2.5.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,3 +1,17 @@
1
+ ## [2.5.3](https://github.com/eliotstocker/Brsh-JS/compare/v2.5.2...v2.5.3) (2026-05-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * terminal column sizing ([555ba7f](https://github.com/eliotstocker/Brsh-JS/commit/555ba7f4a961a2db227d844c33039c1a9c3e2f3b))
7
+
8
+ ## [2.5.2](https://github.com/eliotstocker/Brsh-JS/compare/v2.5.1...v2.5.2) (2026-05-25)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * symlinking etc sorted ([7baf30d](https://github.com/eliotstocker/Brsh-JS/commit/7baf30df99f3d4fd6d46b3da2a337c3ff6efe755))
14
+
1
15
  ## [2.5.1](https://github.com/eliotstocker/Brsh-JS/compare/v2.5.0...v2.5.1) (2026-05-25)
2
16
 
3
17
 
@@ -116,10 +116,10 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
116
116
  - [x] `mkdir`
117
117
  - [x] `chmod`
118
118
  - [x] `cd` / `pwd`
119
- - [ ] `touch`
119
+ - [x] `touch`
120
120
  - [ ] `find`
121
- - [ ] `ln` (symlinks)
122
- - [ ] `stat`
121
+ - [x] `ln` (symlinks — real FS only; `-s` symlinks, hard links, `-f` force)
122
+ - [x] `stat` (real FS: full lstat output; virtual FS: size, type, mode)
123
123
 
124
124
  ### Path Utilities
125
125
  - [ ] `basename`
@@ -144,15 +144,14 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
144
144
 
145
145
  ## Priority Order
146
146
 
147
- 1. **Pipes (`|`)** — unlocks most shell idioms; highest value
148
- 2. **`break` / `continue`** — small change, very common in loops
149
- 3. **`shift` / `unset` / `.` / `:`** — small special builtins, high frequency in scripts
150
- 4. **`$@` / `$*` / `$0`** — needed for argument-forwarding patterns
151
- 5. **`${var:-default}` parameter expansion forms** — very common in real scripts
152
- 6. **`wc`, `head`, `tail`, `sort`, `uniq`, `tr`, `cut`** — most-used text utilities
153
- 7. **`basename` / `dirname`** — common path helpers
154
- 8. **`local`** — function-scoped variables
155
- 9. **`date`, `sleep`, `touch`** — misc utilities
156
- 10. **`set -u` enforcement** — nounset mode
157
- 11. **Glob expansion** — needed for `ls *.txt` style usage
158
- 12. **`sed` / `awk`** — complex; consider wasm or partial implementation
147
+ 1. **Input redirect (`<`)** — needed for many real scripts
148
+ 2. **`shift` / `unset` / `:`** — small special builtins, high frequency in scripts
149
+ 3. **`$@` / `$*` / `$0`** — needed for argument-forwarding patterns
150
+ 4. **`${var:-default}` parameter expansion forms** — very common in real scripts
151
+ 5. **`wc`, `head`, `tail`, `sort`, `uniq`, `tr`, `cut`** — most-used text utilities
152
+ 6. **`basename` / `dirname`** — common path helpers
153
+ 7. **`local`** — function-scoped variables
154
+ 8. **`date`, `sleep`** — misc utilities
155
+ 9. **`set -u` enforcement** — nounset mode
156
+ 10. **Glob expansion** — needed for `ls *.txt` style usage
157
+ 11. **`sed` / `awk`** — complex; consider wasm or partial implementation
package/Readme.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # BRowserSHell (brsh)
2
2
  [![npm version](https://badge.fury.io/js/brsh.svg)](https://badge.fury.io/js/brsh)
3
3
 
4
- An extensible shell written in Javascript with an accompanying terminal emulator
4
+ An extensible POSIX Like shell written in Javascript with an accompanying terminal emulator
5
5
 
6
6
  [Demo](http://eliotstocker.github.io/Brsh-JS/)
7
7
 
8
8
  ## What is it?
9
- A Unix-like Shell backend and Terminal Emulator that lets you embed a working terminal in a webapp, or run an interactive shell against the real filesystem in Node.
9
+ A POSIX Like Shell backend and Terminal Emulator that lets you embed a working terminal in a webapp, or run an interactive shell against the real filesystem in Node.
10
10
 
11
11
  ## Why?
12
12
  No idea, you tell me
@@ -50,6 +50,9 @@ const term = new Terminal({
50
50
  The Terminal constructor options extend those of the Shell:
51
51
 
52
52
  ### Terminal Specific options
53
+
54
+ All [Shell options](#shell-options) are also accepted and forwarded directly to the Shell instance.
55
+
53
56
  | option | required | default | description |
54
57
  | ------ | -------- | ------- | ----------- |
55
58
  | el | Yes | | A HTMLElement to fill with the terminal emulator |
@@ -59,6 +62,7 @@ The Terminal constructor options extend those of the Shell:
59
62
  | animateSpeed | No | `1` | Characters per browser frame for the `type` animation. Higher is faster |
60
63
  | onExit | No | `null` | Function called when the shell session is destroyed. Without this, typing `exit` will leave the terminal in an ended state |
61
64
  | mobileInput | No | `click` | One of `none` or `click`. Set to `click` to enable tap-to-focus (and show the on-screen keyboard on mobile) |
65
+ | lineWrap | No | `false` | When `true`, long lines wrap to the next line instead of overflowing |
62
66
 
63
67
  ### Shell options
64
68
  | option | required | default | description |
@@ -69,6 +73,7 @@ The Terminal constructor options extend those of the Shell:
69
73
  | filesystem | No | `{}` | Object representing the virtual file system. Classes extending `Command` are treated as executables. Use [exportFileSystem](bin/Readme.md) to generate this from a real directory |
70
74
  | permissions | No | `{}` | Map of virtual absolute paths to Unix mode bits (e.g. `{ '/bin/myscript.sh': 0o755 }`). Files without an entry default to `0o644`; function/class entries default to `0o755` |
71
75
  | cwd | No | `'/'` | Starting working directory |
76
+ | onFsChange | No | `null` | Callback fired whenever the virtual filesystem changes (e.g. after a write or delete). Useful for persisting filesystem state |
72
77
  | useRealFilesystem | No | `false` | When `true`, uses the real Node.js filesystem instead of the virtual one. Intended for CLI use |
73
78
 
74
79
  ## Running an interactive shell in Node
@@ -122,6 +127,7 @@ These are simplified versions of standard Unix commands.
122
127
  * `false`
123
128
  * `grep`
124
129
  * `ls`
130
+ * `printf`
125
131
  * `test` / `[`
126
132
  * `true`
127
133
 
@@ -132,15 +138,19 @@ These are simplified versions of standard Unix commands.
132
138
  * `clear`
133
139
  * `cp`
134
140
  * `curl`
141
+ * `. (dot)` / `source`
135
142
  * `exit`
136
143
  * `export`
137
144
  * `jsfunction`
145
+ * `ln`
138
146
  * `mkdir`
139
147
  * `mv`
140
148
  * `pwd`
141
149
  * `read`
142
150
  * `rm`
143
- * `source`
151
+ * `set`
152
+ * `stat`
153
+ * `touch`
144
154
  * `which`
145
155
 
146
156
  ## Adding new commands