Tab key now has indent-aware behavior (MC parity):
- When cursor is in the indent zone (only whitespace before it on
the current line), Tab inserts enough spaces to advance to the
next tab_width boundary.
- When cursor is past any non-whitespace, Tab inserts a single
literal '\t' character for column alignment.
New methods on Editor (editor/mod.rs):
insert_tab_with_indent()
- Computes next_boundary = ((col / tab_width) + 1) * tab_width
- In indent zone: inserts (next_boundary - col) spaces
- Otherwise: inserts literal '\t'
is_in_indent_zone() -> bool
- True if all bytes between line start and cursor are space/tab
Tab handler in editor/handlers.rs routes through
insert_tab_with_indent() instead of insert_char('\t').
Tests (6 new in editor::tests):
- tab_at_col_0_indents_to_next_boundary
- tab_at_col_4_indents_to_next_boundary
- tab_mid_line_inserts_literal_tab
- tab_after_non_whitespace_inserts_literal_tab
- tab_after_whitespace_runs_continues_indent
- tab_inside_word_inserts_literal_tab
Total: 1248 passing (was 1242; +6 new).
Replaces the character-counting wrap in build_wrap_map with a
word-boundary algorithm that matches MC's intent: lines break at
the last whitespace before the wrap limit, mid-word break as
fallback for overlong words, tabs counted as their visual width
(next tab_width boundary), control chars as 2 cols.
New helpers (editor/render.rs):
visual_width(ch, col, tab_width) -> usize
- Tabs: tab_width - (col % tab_width), min 1
- Control chars (0x00..=0x1F, 0x7F): 2 cols (renders as ^X)
- Other chars: 1 col
count_wrapped_rows(line_bytes, body_width, tab_width) -> usize
- Walks line left-to-right, tracks last whitespace position
- On overflow: wrap at last_ws_col (preserves word boundary),
else mid-word break
- Stops at \n (line_bytes excludes \n in caller)
Editor (mod.rs):
- New tab_width: usize field (default 4)
- Matches the renderer's ' ' tab expansion in push_rendered_text
- Future B4 will make this user-configurable
Tests:
+12 wrap_tests in editor::render::wrap_tests:
- visual_width_tab_expands_to_next_boundary
- visual_width_ascii_and_control
- count_wrapped_rows_empty_line
- count_wrapped_rows_short_line_fits_in_one_row
- count_wrapped_rows_exact_fit
- count_wrapped_rows_one_char_overflow_no_whitespace
- count_wrapped_rows_word_boundary_break
- count_wrapped_rows_three_words_at_width_six
- count_wrapped_rows_long_word_falls_back_to_mid_word
- count_wrapped_rows_tab_visual_width
- count_wrapped_rows_zero_width_returns_one
- count_wrapped_rows_stops_at_newline
Total: 1242 passing (was 1230; +12 new).
Implements all 5 critical parity items from the comprehensive MC
assessment. Reference: MC source at local/recipes/tui/mc/source/.
A1 — Editor line number gutter:
Split editor inner area into gutter_area + body_area; gutter
renders right-aligned line numbers (or relative offsets when
relative_lines mode is on); bookmark rows show current-line
style; ~ shown for lines past end-of-file.
A2 — Viewer cursor line highlight:
cursor_line_bg derived from body_bg + RGB(12,12,12); applied
before search-match overlay so matches win on the cursor line.
A3 — Hide terminal cursor in file manager mode:
App::run() hides the cursor after Tui::new(); render() shows
the cursor only when editor/viewer/cmdline/dialog/menubar
is active.
A6 — Shift-F5/F6 same-directory rename:
New Cmd::CopySameDir and Cmd::MoveSameDir variants, bound to
Shift-F5 / Shift-F6. Reuse CopyDialog/MoveDialog with a new
same_dir flag and new_rename() constructor; result() resolves
the typed name against the source's parent directory.
A7 — SUID/SGID/sticky bits in chmod dialog:
4-row PermCell grid (user, group, other, special); class_shift
= 0o4000, bit = 1. Display as 0oXXXX. Overwrite dialog shows
all 12 cells. 6 new unit tests cover all special-bit combinations.
Other fixes in the same commit:
- 4 editor render tests shifted x-coordinates by gutter_chars
to account for the new gutter column.
- 1 viewer text test moves cursor to line 1 so cursor-line
highlight doesn't overlap the search-match assertion.
Tests: 1230 passed (was 1219 before A7; +11 new tests across A7
and A6). All Sprint 1 items compile clean.
MenuBarOutcome::Dispatch now carries Option<usize> indicating which
menu (0=Left, 4=Right) originated the command. app.rs switches focus
to the corresponding panel before dispatching. This matches MC
behavior where the Left menu always operates on the left panel and
the Right menu on the right panel, regardless of which panel had
keyboard focus.
When going UP to a parent directory, find the entry whose name matches
the last component of the path being left (MC's get_parent_dir_name
approach). This is more robust than saved-index restoration because it
works even when the parent directory listing changed between visits.
Falls back to saved dir_cursors index for non-parent navigation.
- viewer/mod.rs: implement MC-style cursor tracking with independent
scroll (move_cursor_down/up/ensure_cursor_visible). Arrow keys now
move cursor within visible area; scrolling only when cursor reaches
edge. last_height field stores render area height for key handlers.
Fixes 'pressing down sends all text off screen'.
- panel.rs: save and restore BOTH cursor AND top scroll position in
dir_cursors HashMap. Previously only cursor was saved and top was
always reset to 0, causing ensure_cursor_visible to snap the view
on every directory switch.
- panel.rs: fix try_enter_archive to construct VFS URL with correct
scheme prefix (zip://, tar://) instead of parsing raw file path
as Local. Fixes .zip/.tar hang on Enter.
- terminal/event.rs: rewrite parse_unsupported_key to handle CSI-tilde
modifier sequences (\x1b[15;5~ = Ctrl-F5) and CSI arrow modifier
sequences (\x1b[1;5B = Ctrl-Down). Returns tlc Key directly with
modifiers set, bypassing termion's limited TermKey enum.
- app.rs: simplify event dispatch to use Key directly from
parse_unsupported_key, removing dead TermKey variable.
- 6 new tests for modifier+function-key and modifier+arrow parsing.
- cursor.rs: move_left walks back over UTF-8 continuation bytes,
move_right steps by char width via utf8_len_from_lead(), move_up/down
snap to char boundary via snap_to_char_boundary()
- mod.rs: update_bracket_flash adds defensive is_char_boundary() check
- render.rs: remove gutter/column layout, body_area = inner (matches MC
editdraw.c line_state=FALSE default); bookmark colors applied to
body line base_style (matches MC book_mark line coloring)
- text.rs: remove gutter rendering and Paragraph .wrap(); implement
pre-wrapping via wrap_line() for wrap mode; body uses full width
- Tests updated for new no-gutter layout (4 tests, all pass)
Wire three Command menu items that open TLC's config files in
the built-in editor: extensions, user menu, and file highlighting
rules. Files are created empty if they don't exist.
Cmd::EditExtensionFile → ~/.config/tlc/extensions
Cmd::EditMenuFile → ~/.config/tlc/menu
Cmd::EditHighlightFile → ~/.config/tlc/filehighlight.ini
Added open_config_file() helper in dialog_ops.rs that resolves
the config dir via ProjectDirs, creates parent + empty file if
missing, then opens the editor.
Command menu now has all 20 items (was 17/20).
The local bootloader fork claims to be upstream 1.0.0 + Red Bear
patches, but the patches in local/patches/bootloader/ do NOT
apply cleanly to upstream 1.0.0. The fork was originally a 0.1.0
baseline with substantial additions that pre-date the upstream-1.0.0
refactor.
Changes:
* local/fork-upstream-map.toml: set bootloader's upstream tag to
PENDING_REBASE. The verifier recognises this as a deliberate
state marker (a fork whose rebase is in progress) and refuses
the build with a clear error pointing the user to the rebase
procedure documented in the map.
* local/scripts/verify-fork-versions.sh: when a fork is marked
PENDING_REBASE in the map, the script reports a dedicated error
message instead of running the upstream content comparison (which
would always fail for a fork in this state).
The current state of the build is:
* 5 of 6 `-rb1` Cat 2 forks pass the no-fake-version-label
check (redoxfs, redox-scheme, kernel, installer, userutils).
* bootloader refuses to build until a real rebase onto a chosen
upstream tag is completed (the patches must apply cleanly with
--fuzz=0).
* installer has additional divergent content that may need a
rebase too (separate operational task).
This is the strict enforcement the user asked for. The build
cannot proceed silently with fake labels. The user must drive
the rebase work for bootloader (and installer) following the
procedure in fork-upstream-map.toml.
Wire New, Open, Save, SaveAs, Quit, Find, FindNext, FindPrev,
Replace, BookmarkNext, BookmarkPrev through dispatch_editor_cmd.
Previously these printed 'F9: Cmd (not yet wired)'. Now each one
performs the actual operation matching its Alt-key/F-key equivalent.
open_save_before_close_prompt made pub(crate) so the Quit handler
can intercept dirty buffers.
Add ToggleAutoIndent, ToggleShowWhitespace, ToggleWordWrap,
ToggleSyntax, ToggleRelativeLines to EditorCmd enum and dispatch
them through dispatch_editor_cmd. The Options menu now has all
five toggles alongside Settings, making them discoverable via F9
in addition to their Alt-key shortcuts.
The SortDialog was wired to Alt-Shift-T in §31.1 but was missing
from the F9 menu bar. MC has 'Sort order...' under both Left and
Right menus. Added to both.
§32.1 Viewer word-wrap fix: Paragraph .wrap() was always applied
regardless of the v.wrap toggle. Now .wrap(Wrap { trim: false }) is
conditionally applied only when v.wrap is true. When wrap is off,
long lines truncate at the right margin (MC parity). Stale TODO
removed from render_line_with_highlight.
§32.2 Alt-W wrap toggle test verifying the field toggles correctly.
PLAN §14.7 table refresh: 30+ stale entries corrected. Phase 14b
6/6 done. Phase 14c 14/15 done (1 WONTFIX). Phase 14d ~17/25 done.
Overall ~90% MC parity.
Tests: 1213 passed, 0 failed.
Per local/AGENTS.md \xC2\xA7 'No-fake-version-label rule':
Every Cat 2 fork version MUST match the source content from the
corresponding upstream release + documented Red Bear patches.
A `-rbN` label on stale content is a fake label and a policy
violation.
Changes:
* local/AGENTS.md: documented the no-fake-version-label rule,
including what counts as a fake label, the enforcement contract,
and what a real Red Bear fork looks like.
* local/fork-upstream-map.toml: authoritative mapping of each
Cat 2 fork (syscall, libredox, redoxfs, redox-scheme, relibc,
kernel, bootloader, installer, userutils) to its upstream Git
URL and release tag.
* local/scripts/refresh-fork-upstream-map.sh: auto-update the
fork-upstream-map by querying each upstream repo for the
current latest stable release tag.
* local/scripts/verify-fork-versions.sh: preflight enforcement
script. For each Cat 2 fork with a `-rbN` version field:
1. Compare fork's file list and content against the upstream
release tag from the map. Reject the build if files are
missing (would be a fake label).
2. Reject the build if files exist in local that don't exist
in upstream (must be moved to local/patches/<fork>/ as
documented Red Bear patches).
3. Reject the build if shared files diverge in content.
* local/scripts/apply-rb-suffix.sh: invokes
verify-fork-versions.sh after applying the `-rbN` label so the
build fails fast if the labelled content is fake.
* local/scripts/build-preflight.sh: invokes
verify-fork-versions.sh at the start of every build. Bypassed
only with REDBEAR_SKIP_FORK_VERIFY=1 (emergency only).
* local/patches/bottom/0001-ratui-0.30-braille-compat.patch: the
ratatui 0.30+ compatibility shim for bottom 0.11.2.
This is the structural enforcement that prevents fake labels from
ever reaching the build again. The current 6 forks with `-rbN`
labels are flagged by the verifier — they must be rebased onto
their actual upstream release before the build can succeed.
Red Bear OS needs a local fork of redox-scheme to enforce the -rb1
version policy end-to-end. crates.io redox-scheme 0.11.2 pins
redox_syscall = "0.9.0" exactly and libredox = "0.1.18" exactly,
which Cargo refuses to satisfy with the local -rb1 forks.
The fork is implemented as a TRACKED TREE under local/sources/redox-scheme/
on the active 0.2.5 branch (per local/AGENTS.md), not as a separate
git repository or as a separate submodule on its own branch.
The single-repo rule from local/AGENTS.md is preserved: this
directory is a regular subdirectory of the RedBear-OS repo, not a
separate repository.
Add comprehensive policy documentation in AGENTS.md covering:
- local/ fork always takes precedence over recipes/ paths
- build system must ensure local fork is at latest available version
- all Red Bear patches must be applied cleanly on top of latest version
- automatic version bump + patch reapplication via bump-fork.sh
Create local/scripts/bump-fork.sh that implements automatic version bumping:
- Detects current local version vs required version from Cargo.lock
- Fetches upstream source at required version
- Applies all Red Bear patches atomically
- Updates version field and replaces local fork contents
Fix driver-manager Cargo.toml lockfile collision:
- Remove redundant syscall dependency (transitive via pcid_interface)
- Update all driver recipes to use local/sources/syscall and libredox paths
- This eliminates the redox_syscall lockfile collision between
local/sources/syscall and recipes/core/base/syscall (same dir, different paths)
relibc: fix unsafe call for Rust 2024 edition compatibility
All three were blocking the boot scheduler in /usr phase on live-mini
because their daemons never notify readiness without hardware present.
- 00_gpiod.service: scheme -> oneshot_async
- 00_i2cd.service: scheme -> oneshot_async
- 00_pcid-spawner.service: new override, oneshot -> oneshot_async
- base: update submodule to 4a1d1f4 (scheduler counter)
Replace all non-canonical build invocations (bare 'make all/live
CONFIG_NAME=', 'scripts/build-iso.sh', 'scripts/run.sh') with the
canonical './local/scripts/build-redbear.sh' wrapper.
Updated: AGENTS.md, local/AGENTS.md, README.md, docs/README.md,
docs/06-BUILD-SYSTEM-SETUP.md, and 6 active local/docs plan files.
Archived docs and frozen boot-logs left as-is (historical evidence).
Updates kernel submodule to 573b3e6 which replaces context::current()
with context::try_current() in excp_handler(), preventing the cascading
'not inside of context' panic when a page fault occurs during BSP's
start() before context::init() runs.
The cmake-generated Qt6ShaderToolsConfig.cmake has an empty
extra_cmake_include list. Patch it to include Qt6ShaderToolsMacros.cmake
so qt_internal_add_shaders is defined for downstream modules.
cmake install skipped this 405-line macros file that defines
qt_internal_add_shaders/qt6_add_shaders. Without it, downstream Qt
modules (qtdeclarative) fail at cmake configure with 'Unknown CMake
command qt_internal_add_shaders'.
Qt6's standalone module build installs qsb binary but does not generate
the Qt6ShaderToolsTools cmake wrapper package needed by cross-compile.
Added a Python generator that creates the minimal cmake package files
(Config, Targets, Targets-release, Precheck, AdditionalTargetInfo,
VersionlessTargets, Dependencies, ConfigVersion) following the exact
pattern of Qt6WaylandScannerTools from qtbase host build.
qtshadertools cross-compile needs the host 'qsb' (Qt Shader Builder)
tool, just like qtbase needs host moc/rcc/uic. Added a native cmake
build step that compiles qsb from the 6.11.1 source and installs it
into the shared qt-host-build prefix.
Also regenerate pam-redbear Cargo.lock (stale after 0.2.5 version bump
of redbear-login-protocol path dependency).
The host tool build profile was hardcoded with '6.11.0', causing the
stale 6.11.0 host tools to be reused for the 6.11.1 cross-compile.
Updated profile string to invalidate old host build.
Upstream Qt 6.11.1 already absorbed the #if QT_CONFIG(opengl) guards in
qwaylandclientbufferintegration_p.h that our redox.patch was adding.
Removed the now-obsolete hunks per patch governance (rebase, drop if
upstream absorbed it).
All remaining hunks apply cleanly against 6.11.1 with minor line offsets.
- Cookbook Cargo.toml: 0.1.0 → 0.2.5
- All 61 in-house crate Cargo.toml versions: 0.2.4 → 0.2.5
- os-release.in: fix URLs from github.com to gitea.redbearos.org
- sync-versions.sh --check passes with zero drift
The OS version is derived from the git branch name at build time.
Building on branch 0.2.5 produces os-release with VERSION_ID=0.2.5.
Records actual recipes bumped in 0.2.5 on 2026-07-02:
- Qt stack 6.8.2/6.11.0a1 -> 6.11.1 (all 6 sub-recipes, verified BLAKE3)
- Wayland/DRM/Input/expat/seatd to upstream latest stable (8 recipes,
verified BLAKE3)
- KWin 6.3.4 -> 6.7.2 + kdecoration 6.3.4 -> 6.7.2 + konsole 24.08.3
-> 26.04.3
Plus structural fix: created the missing qtshadertools recipe so the
qtdeclarative dependency chain resolves.
Documents what was deliberately NOT done:
- KF6 6.10 -> 6.27.0: 38 frameworks, 17-minor delta. Per AGENTS.md
patch-governance, no commit that bumps recipe.toml URLs without
first rebasing the local patches can be made honestly. Rebase
work (17-minor * 38 recipes) is multi-day and recorded as open.
- Mesa 24.0.8 -> 26.1.4: blocked on redox-os/mesa fork rebase
(0.3.0 work).
Includes the rebase order for the next session that plans to run
'make all CONFIG_NAME=redbear-full' against the bumped pins.
Bump KDE Plasma + KDE utility recipes to upstream latest stable
on 2026-07-02.
Versions resolved against download.kde.org/stable/plasma/ and
invent.kde.org/plasma/* tags:
kwin 6.3.4 -> 6.7.2 (invent.kde.org/plasma/kwin)
kdecoration 6.3.4 -> 6.7.2 (invent.kde.org/plasma/kdecoration)
konsole 24.08.3 -> 26.04.3 (invent.kde.org/utilities/konsole;
note: KDE utility versioning switched
from YY.MM calendars to v26.04-style)
BLAKE3 hashes verified against the actual downloaded upstream tarballs.
State of source trees on disk (NOT touched by this commit):
- local/recipes/kde/kwin/source/ : still KWin 6.6.5 (prior
session imported 6.6.5 source; new tarball at v6.7.2 will replace
on next repo fetch).
- local/recipes/kde/kdecoration/source/ : still 6.3.4
- local/recipes/kde/konsole/source/ : still 24.08 (RELEASE_SERVICE_
VERSION_MAJOR/MINOR).
Per AGENTS.md fork-adaptation policy, patches in local/patches/
{kwin,kdecoration,konsole}/ must be re-applied against the new
upstream source trees after fetch; rebase is open work for the
next session. Disabling patches or wrapping with feature flags is
NOT acceptable per the in-tree stub/workaround zero-tolerance rule.
This commit does NOT bump any KF6 framework recipe (38 recipes,
17-minor upstream delta). That work is multi-day patch rebase and
remains open.