Skip to content

Add 'config edit' to open the config file in your editor #254

Description

@jongio

Problem

The config command can read and change one scalar setting at a time (config get, config set), and config path prints where the file lives. But some settings are lists or maps (saved views, hidden sessions, notes, color schemes) that the scalar set path does not expose, and there is no quick way to review or hand-edit the whole file. Today you have to run dispatch config path, then find and open the file in an editor yourself.

Proposed solution

Add a config edit subcommand that opens the config file in the user's editor:

  • Resolve the editor from $VISUAL, then $EDITOR. Fall back to a sensible platform default (notepad on Windows, nano/vi on Unix) when neither is set.
  • Make sure the file exists first (write the current values, which are the defaults when nothing has been saved yet) so the editor always opens a real file.
  • Run the editor attached to the terminal and wait for it to close.
  • After it closes, re-read the file and report a clear error if the edited content no longer parses, so a typo does not silently break the config.

Acceptance criteria

  • dispatch config edit opens the resolved config file in $VISUAL/$EDITOR (or a platform default) and waits for the editor to exit.
  • The config file is created with current values if it does not exist yet.
  • Invalid edits are reported with a clear parse error and a non-zero exit.
  • The subcommand shows up in help, the config help section, and the bash/zsh/fish/powershell completion lists.
  • Unit tests cover editor resolution (VISUAL over EDITOR over default), the file-created case, and the invalid-edit error path, using a stubbed editor launcher.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions