Commit Graph
183 Commits
Author SHA1 Message Date
Raven Scott ef0301f435 fix(edit,nano): bracketed paste + bounded prompts so Save-as cannot flood
Enable xterm bracketed paste (?2004h/?2004l), parse ESC[200~…201~ as a single
paste event, insert paste in the buffer with one undo step, and replace
prompt input with first-line sanitized text capped by BARE_EDIT_MAX_PROMPT.
Cap typed prompt length for terminals without bracketed paste. Extend tests and
rebuild kernel /bin edit and nano bundles.
2026-04-21 18:45:55 -04:00
Raven Scott 36492de3d9 bare-ssh2 parses SFTP handles via bufferSlice/safer-buffer — handles are often
Uint8Array views that fail Buffer.isBuffer; READ/CLOSE/FSTAT/WRITE/READDIR were
rejecting every request with SSH_FX_FAILURE. Add sftpHandleId() using DataView.

OPEN: fix inner try indentation. CHANGELOG: note handle decoding + earlier SFTP
hardening (vfs normalize, enqueueSftpReply, Protocol/SFTP DATA coerce).
2026-04-21 18:22:32 -04:00
Raven Scott ac699f308e SFTP shim: coerce vfs.readFile via normalizeVfsBytesForSftp before storing
handles; use f.buf == null instead of !f.buf so empty buffers/strings do not
force SSH_FX_FAILURE on READ. READ accepts Buffer, typed views, or string after
WRITE.

Earlier in this branch: enqueueSftpReply(reqid) + FAILURE on errors; REQUEST.READ
validation in vendor bare-ssh2; coerce typed arrays to Buffer in SFTP.data and
Protocol.channelData/channelExtData. CHANGELOG notes.
2026-04-21 18:12:56 -04:00
Raven Scott baae7b3482 VFS readFile often returns Uint8Array; SFTP DATA and CHANNEL_DATA assumed
Buffer.isBuffer or treated payloads as UTF-8, corrupting packets and risking
native aborts (bad_optional_access). Normalize ArrayBuffer views in
SFTP.prototype.data and Protocol channelData/channelExtData; align READ shim.

Also includes earlier SFTP hardening: REQUEST.READ/WRITE/FSETSTAT guards,
enqueueSftpReply(reqid) + FAILURE on handler error, CHANGELOG.
2026-04-21 18:06:22 -04:00
Raven Scott 0359129a72 - SFTP.js: validate handle/offset/len on REQUEST.READ; guard WRITE/FSETSTAT
handle access like other handlers (avoid throwing before doFatalSFTPError).
- bare-openssh-sftp: enqueueSftpReply(reqid, fn) sends SSH_FX_FAILURE on
  handler throw/reject; defensive READ path (buffer/finite offsets).
- Document regression (bad_optional_access / -fno-exceptions) in comments;
  add packages/bare-os-openssh/CHANGELOG.md Unreleased entry.
2026-04-21 18:01:34 -04:00
Raven Scott 98dd91020e feat(shell): job-aware kill, disown, jobs/set flags, fallback REPL history
- Document interactive shell vs /bin/sh in bare-os-shell man, handbook §9,
  kill(1), and shell-completion guide
- Resolve kill %n and %% to synthetic PIDs via shellBackgroundJobs
- Add disown builtin; jobs -p (pgid-only) and -l (pid column); set -o/+o to
  print errexit/nounset/pipefail/noglob
- Expand completion-engine fallback flags for common utilities
- Persist lines to /.bare/repl_history_<USER> when BARE_OS_REPL_HISTORY=1
  and Fish REPL is off (repl-session + cli-readline)
- Tests: kill job specs, set -o output, jobs -p
2026-04-21 17:26:41 -04:00
Raven Scott c50bee46eb fix(openssh): serialize SFTP replies to fix FileZilla request ID mismatch
Queue all outbound SFTP responses (including READ/CLOSE) so async handlers
(REALPATH, STAT, OPENDIR, READDIR, …) cannot reorder packets vs strict clients.
Handle EXTENDED/SETSTAT/FSETSTAT via the same queue instead of bare-ssh2’s
immediate OP_UNSUPPORTED fallback.
2026-04-21 16:55:52 -04:00
Raven Scott caa60e3167 fix(openssh): widen SFTP path policy and return real dir/file metadata
Allow SFTP clients to reach the same logical paths as the shell (system
image, pseudo, home, mounts), deny mutating OPEN on typical read-only
prefixes, merge file/dir handle IDs to avoid collisions, implement FSTAT,
stat-based READDIR NAME attrs/longnames, and improve REALPATH.

Add brittle tests for path policy and wire test.bare-openssh-sftp.js into
npm test.
2026-04-21 16:44:31 -04:00
Raven Scott 643e93a1f9 Updates 2026-04-09 21:02:51 -04:00
Raven Scott 6b1555eea9 fixes 2026-04-09 20:48:03 -04:00
Raven Scott c8c877f688 Holesail Service Daemon + Bin Client 2026-04-09 20:42:54 -04:00
Raven Scott 3a69906046 fix(bare-openssh): send CR before command output on SSH PTY after line submit
Fish and bare-readline end the edited line with LF only; many SSH PTYs do not
return the cursor to column 0, so ls/man and other command output started
mid-row. Write `\r` after releasing the line editor and before execShellLine
to align output with the peer terminal.
2026-04-09 01:24:07 -04:00
Raven Scott a86432deff Prefer createFishReadLine for interactive SSH shells (history, arrows,
completion) when BARE_OS_FISH is not 0, matching the in-app terminal.

Keep bare-readline + per-command recycle only as fallback. Wire
suspendReplForSubprocess / resumeReplAfterSubprocess on the SSH child ctx to
suspendFishStdinForSubprocess / resume on the channel stream so baretop and
edit release the correct stdin.

Teardown: disableFishRawMode + releaseFishStdin when the session ends.
2026-04-09 01:16:25 -04:00
Raven Scott 01eddc84bf fix(bare-openssh): stop syncing TERM from PTY to fix SSH TUIs (baretop)
PTY env sync now only updates COLUMNS and LINES. Writing the client TERM
(e.g. xterm-256color) into the forked session env enabled baretop’s default
incremental line-diff, which mis-renders over SSH. Inherited guest TERM is
unchanged, matching in-app terminal behavior.
2026-04-09 01:03:19 -04:00
Raven Scott 2b9a10e371 Normalize embedded newlines to CRLF in SSH child ctx console log/error so
multiline output (e.g. man, bare-slice pager) matches real PTY behavior and
avoids misaligned lines vs the peer terminal.

Mirror pty-req TERM and dimensions into forked session vfs.env (COLUMNS,
LINES) when bareOsForkShellEnv is used; clear target on session end.

Add bare-openssh-pty-console helper module and brittle tests; re-export
formatter from bare-openssh for API parity.
2026-04-09 00:53:45 -04:00
Raven Scott 2f80913271 Updates to btop 2026-04-09 00:28:11 -04:00
Raven Scott b1607f78fa fix(kernel-runner): bind console to ctx.console in eval'd user scripts
AsyncFunction bodies used global console.log, so ./script.js output over SSH
went to Pear instead of the session TTY. Prepend var console = ctx.console
when ctx.console is present.
2026-04-09 00:10:51 -04:00
Raven Scott a08e1891d3 fix(bare-openssh): drop stray ">" after commands (readline PS1 on recycle)
bare-readline treats empty prompt as falsy and defaults to ">"; each SSH
readline recycle painted that before setPrompt. Pass initialPrompt from
the real PS1, defer first attach until after profile/barerc, and skip the
extra \\r\\n after recycled bare-readline.
2026-04-08 23:59:39 -04:00
Raven Scott 277300b716 fix(bare-openssh): recycle readline after TUIs (e.g. baretop) on SSH
Close bare-readline before each execShellLine and attach a new session
afterward so fullscreen apps own stdin; avoids a corrupted KeyDecoder
and a frozen prompt when baretop/edit exit.
2026-04-08 23:51:20 -04:00
Raven Scott 85bb26fb57 fix(bare-openssh): apply SSH pty size to channel stream for TUIs
Wire pty-req and window-change to set columns/rows on the session
stream so /bin/edit (nano) and similar apps use the real terminal
geometry instead of defaulting to 80x24.
2026-04-08 23:42:48 -04:00
Raven Scott 1ff94f0b48 fix(bare-openssh): bind repl TTY streams to SSH session for edit/nano
Route replStdin, replStdout, and stdout to the SSH channel Duplex so
/bin/edit (nano) and other TUI tools use the remote terminal instead of
Pear CLI. Mark exec channels as TTY for ssh ... nano style invocations.
2026-04-08 23:35:08 -04:00
Raven Scott 198b1b02e3 Allow Multi Session SSH 2026-04-08 23:28:05 -04:00
Raven Scott 8d9f79600c Auto Create Autorized_Keys 2026-04-08 23:07:07 -04:00
Raven Scott 4ad6c08129 Updates 2026-04-08 22:48:55 -04:00
Raven Scott 28323589a8 Update 2026-04-08 22:37:38 -04:00
Raven Scott 710859eaa4 Tests 2026-04-08 22:28:59 -04:00
Raven Scott f8a722ee70 Updates 2026-04-08 22:21:22 -04:00
Raven Scott f4b7798e5d Packaging Tests 2026-04-08 22:11:08 -04:00
Raven Scott d51ed58189 Fix imports 2026-04-08 21:53:33 -04:00
Raven Scott dfeb925776 Closer SSH 2026-04-08 21:43:08 -04:00
Raven Scott 7739b21043 SSH Updates 2026-04-08 21:24:04 -04:00
Raven Scott 385fc80894 Updates 2026-04-08 20:53:38 -04:00
Raven Scott dc9be9eaff Updates 2026-04-08 20:42:56 -04:00
Raven Scott 2d851dbaf2 updates 2026-04-08 20:27:25 -04:00
Raven Scott f6fb3179f3 Further fixes SSH 2026-04-08 20:19:05 -04:00
Raven Scott 355a6ef344 Fixes for SSH 2026-04-08 20:12:29 -04:00
Raven Scott 4757b2a4b0 Starting work on Implementing SSH Server Service 2026-04-08 20:02:12 -04:00
Raven Scott ef14f23a10 Update Doc 2026-04-06 21:04:58 -04:00
Raven Scott c2ca5e22b6 Remove not needed item from README 2026-04-06 09:37:51 -04:00
Raven Scott e470749aaa Update Bundles 2026-04-06 09:37:13 -04:00
Raven Scott 8d3d12d6f6 Update bundle 2026-04-06 08:49:54 -04:00
Raven Scott ce9d4a7a56 Update default banner 2026-04-06 08:47:54 -04:00
Raven Scott 27403241c8 Remove CI 2026-04-06 08:45:32 -04:00
Raven Scott dc85aed876 Fix Terminal Cursor 2026-04-06 08:37:38 -04:00
Raven Scott f2a58ddb67 AutoComplete Engine 2026-04-06 08:24:21 -04:00
Raven Scott 8322f304d8 Update Manpage 2026-04-06 07:32:05 -04:00
Raven Scott 7f0f5277a9 Update Docs 2026-04-06 06:44:58 -04:00
Raven Scott f0fb05274b Update Docs 2026-04-06 06:44:15 -04:00
Raven Scott 6d0d1b8049 Update Docs 2026-04-06 06:31:59 -04:00
Raven Scott 140b17c5fd Update Docs 2026-04-06 06:17:03 -04:00