Commit graph

12 commits

Author SHA256 Message Date
77c6d7977a bjoterm 0.1.1, for prompts with line breaks; test reload in one shell
- Depends on bjoterm 0.1.1: a prompt may contain line breaks.
- tests/extension.bjo: a change, then reload, in the same bjosh runs the
  new code. Bjolang's (std plugin) now loads a rebuilt module anew.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:49:30 +01:00
817de694b0 Build the user commands with $BJO, after the start-up file
- The build runs $BJO, else bjo on PATH. A bjo that is not there gives a
  message that says what to set, and where.
- An interactive bjosh runs the start-up file first, and loads the user
  commands after it, so the file can set PATH or BJO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:22:07 +01:00
bf961b12f9 Write the package of user commands on the first interactive start
When $XDG_CONFIG_HOME/bjosh/commands is not there, an interactive bjosh
writes it with the example, then builds and loads it. An empty directory
turns this off. --new-commands stays, for a start that is not interactive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:57:19 +01:00
aa5bae96e0 Fetch bjoterm from rikspucko, by its version tag
bjoterm is now a git dependency, at version 0.1.0 or later, pinned in
bjo.lock. So a clone of bjosh builds on any computer that has Bjolang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:48:37 +01:00
84bd2f3382 Phase 4: commands in Bjolang
- A package of user commands in $XDG_CONFIG_HOME/bjosh/commands. Its
  module commands.bjo exports bjosh-extension: value commands, shell
  commands and a prompt function.
- (bjosh api): the types and functions a package imports.
- (bjosh user): builds the package when it is stale, and loads it with
  (std plugin) at each start. `reload` builds and loads it again.
- bjosh --new-commands writes a package with an example.
- No Native AOT, because it cannot load modules. bin/bjosh starts
  src/main.exe.
- tests/extension.bjo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:38:40 +01:00
f8c4ad64bc Phase 3: $(...), aliases, a start-up file, PROMPT, Done lines, >&2
- $(...) runs in a subshell. A word that is only an unquoted $(...) is
  one word per line. X=$(cmd) sets $? to its status.
- alias, unalias, and command NAME. An alias is one pipe.
- ~/.config/bjosh/rc runs before the first prompt.
- PROMPT, expanded as in double quotes, with \w \W \u \h \$ \e \n.
- "Done" lines are written above the input while the prompt waits.
- >&2, for programs and value commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:50:15 +01:00
f54ceb35af Ctrl-C of a value command that reads a terminal or a FIFO
The file of < is opened with #:cancellable? #t, so Ctrl-C of
li < /dev/tty takes nothing from the terminal, and the next line goes to
the editor. tests/interactive.bjo checks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 08:13:20 +01:00
8ded734477 echo as a value command
- echo gives its words as one string, and shadows the program.
- With -n, -e or -E it runs the program echo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 07:29:10 +01:00
acd84a2a4c Phase 2: jobs and history as values, redirections of value commands
- jobs and history are value sources in a pipe; alone they write text.
- < on the first value command of a group, > and >> on the last,
  which then writes lines. A value command after > is an error.
- File errors use fs-error-message, without a stack trace.
- plan.org: Ctrl-C does not cancel a blocking read of a terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 07:21:04 +01:00
027acc84e6 Phase 2, first part: values and value commands
- Values are Json of (text json); a record is JsonFields.
- Value commands: files, procs, open, where, select, get, sort-by,
  first, last, count, reverse, uniq, lines, from-json, to-json,
  from-csv, to-csv, each with a short name.
- Value commands next to each other run as one unit: a (std run)
  filter in a job, or in the shell when a line has no program.
- Records are shown as a table; values go to programs as lines.
- A name is a shell command, a short name, a program on PATH, then a
  long name.
- 2>&1, with >FILE 2>&1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 07:05:09 +01:00
3518b7711d Phase 1: POSIX command lines, job control and the prompt
- (bjosh syntax): a part of POSIX sh, parsed with (text
  parser-combinators). Syntax that is not supported raises an error that
  names it.
- (bjosh expand): variables, ~ and globs. Values are not split.
- (bjosh exec): pipes as (std run) jobs, && || ; &, redirections, and
  NAME=value through env.
- (bjosh shell) and (bjosh builtins): the job table and cd, pwd, exit,
  export, unset, jobs, fg, bg, kill, type, help, history.
- (bjosh editor): Enter waits for open quotes and trailing operators;
  completion of commands and files.
- -c LINE, FILE, and stdin. A Native AOT build too.
- Tests: the parser, expansion, the editor, lines through -c, and job
  control under script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:19:45 +01:00
7f585bd0b2 bjosh: the plan, and an empty package
A shell: POSIX command lines, job control, and built-in commands in
Bjolang that pass values. plan.org has the decisions and the phases.
It depends on bjoterm, on disk at ../bjoterm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:22:18 +01:00