Skip to content

fix(startup): avoid first-launch config warning - #362

Merged
fcoury merged 1 commit into
mainfrom
fcoury/first-run-config
Sep 6, 2026
Merged

fix(startup): avoid first-launch config warning#362
fcoury merged 1 commit into
mainfrom
fcoury/first-run-config

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

On a fresh launch, Red loads embedded defaults when config.toml is absent. The default red.log is opened before ~/.config/red exists, however, so startup reports a CFG303 configuration problem and disables logging. Session setup creates the directory later, leaving a misleading warning on the first run.

What

Create the configuration directory at the start of interactive editor startup, before loading runtime configuration. config.toml remains optional; Red still creates the starter file only when the user requests it.

Add a regression test that launches Red with an empty XDG_CONFIG_HOME and checks that the default log opens without creating config.toml.

How to Test

  1. Set XDG_CONFIG_HOME to a fresh empty directory and launch the built red in a terminal.
  2. Confirm the welcome opens without a configuration-problem warning. Check that red/red.log exists and red/config.toml has not been created unless you choose the starter config.
  3. Launch Red again with the same config home and confirm it starts without a configuration warning.

Targeted test: cargo test --test first_launch (passed).

@fcoury
fcoury merged commit bb9bd41 into main Sep 6, 2026
12 checks passed
@fcoury
fcoury deleted the fcoury/first-run-config branch September 6, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants