Repository navigation
[CTX-0298] fix(config): honor terminal.shell at startup spawn (Closes #495) - #497
Merged
Merged
Conversation
Xuepoo
force-pushed
the
ctx-0298/fix-shell-knob
branch
from
September 10, 2026 15:04
cf88855 to
12996dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Priority: P1 | Area: config | Labels: fix,area:config,P1 | Milestone: v0.1.0 | Task: CTX-0298
Closes #495
Summary
terminal.shellwas parse/validate/merge/attribution/reload/trust-complete but dead: the startup spawn path resolved only the CLI program or$SHELL, so the accepted config value had no effect (CTX-0295 verification matrix, row 9).Root cause:
crates/bitty-app/src/main.rsresolve_spawn_program/resolve_default_shell/SpawnSpec::resolvenever consultedapp_config.effective.terminal.shell; onlybitty config checkread it for display.Fix
terminal.shell>$SHELL>/bin/sh.SpawnSpec(split panes, headless fallback) carries and replays the configured shell, so every leaf gets the same resolution.argv[0]throughout: no shell interpolation, no word splitting.terminal.shellvalidation rejects control characters; the spawn-time resolver defensively trims and skips blank/oversized/control-laden values, falling through to the next layer. A configured shell that fails to spawn retries/bin/sh, exactly like the existing$SHELLfailure path.trust::validate_project_planrejectsterminal.shellin project config) is unchanged.Security (process authority)
sh -c, no argument construction, no interpolation; thebitty-ptybuilder execs the directargv[0]./bin/shremains the terminal fallback.Tests
crates/bitty-app/src/main.rs): precedence, trimming, fail-closed blank/oversized/control values, explicit-program precedence,SpawnSpecreplay.terminal.shellfail closed (crates/bitty-config/src/types.rs).#[cfg(unix)], real PTY): configured fake shell writes a marker; blank config falls to$SHELL; missing configured shell falls back to/bin/sh.crates/bitty-app/tests/shell_knob.rs: isolatedXDG_CONFIG_HOMEinit.luasetsterminal.shell;bitty --headlesswith a hostile$SHELLmust logeffective program "<fake>" (explicit=false, configured_shell=true)/spawned default shell "<fake>"and run the configured shell asargv[0]; the unconfigured control case keeps spawning$SHELL.Documentation
bitty-docshas noterminal.shellreference (configuration docs are candidate schema only), so no cross-repository docs update is required.CHANGELOG.mdUnreleased entry added.Verification
just check(fmt-check, clippy, workspace tests, scratch-paths, pty-gate, actionlint, markdownlint)cargo test --workspace --all-targets --lockedcargo check --target x86_64-pc-windows-gnu --workspace --all-targets