Skip to content

Warnings go to a log you open with Show log, and the status bar counts the ones you haven't seen #473

Description

@a-team-app

Context

Today, when something fails behind the scenes, TuiCode says nothing. A settings file that doesn't parse quietly falls back to defaults, an invalid rebind is skipped, and the file watcher can stop. Each is logged to nowhere, or not logged at all. This task gives those warnings a log file, a way to open it from inside the editor, and a ⚠ n count in the status bar until you've looked. Pitch: #92.

Depends on #442 (Terminal.Gui 2.5), which rewrites how DefaultSettingsService loads settings, the code this task adds warnings to.

Acceptance criteria

  • Put a trailing comma in ~/.tui/TuiCode.settings.json and start TuiCode: the status bar's message reads TuiCode.settings.json has an error, so defaults are in use. sl shows the log, and ⚠ 1 shows on the status bar's right side, before Ln, Col, in the theme's warning colour.
  • The message goes when the next one replaces it; ⚠ 1 stays.
  • Show log (sl) is in the command palette and in the Help menu, below Show diagnostics. It has no default key.
  • sl opens ~/.tui/logs/TuiCode.log as an ordinary editor tab, which can be searched and copied from. If it's already open, sl switches to it.
  • The log names the file and what was wrong, with the line and column from the parse error, and says defaults are in use for the whole file.
  • Opening the log clears ⚠. A new warning brings it back with a new count.
  • Clicking ⚠ 1, icon or count, does the same as sl.
  • A broken keybindings file, a broken grammar associations file, an invalid keybinding override, a user grammar in ~/.tui/grammars that fails to load, and a workspace state file that can't be read or written each add a warning naming the file and the reason, and count towards ⚠.
  • A folder whose changes can't be watched adds a warning saying so.
  • While the log is open, new warnings appear in it (the disk-change notices keep it current).
  • Each session starts a fresh log. The previous session's is kept as TuiCode.1.log; older ones are gone.
  • A crash writes its exception and stack trace to the log, and after the terminal is restored TuiCode prints TuiCode crashed. Details: ~/.tui/logs/TuiCode.log.
  • Information and Debug messages aren't written to the log.
  • AGENTS.md's logging line states the convention: Warning and above go to the log and count towards ⚠, nothing else is written, and the status bar isn't used for diagnostics except the one settings message.

Tests

  • The log provider: Warning and above written in the line format (time, level, message, exception message, indented stack trace); Information and Debug dropped; rotation to TuiCode.1.log and deleting older ones.
  • The unseen-warning count: rises per warning, clears when the log opens, comes back on the next one.
  • Each silent failure above logs a warning naming the file (settings, keybindings, grammar associations with line/column; user grammar; workspace state read and write).
  • The startup message appears only for TuiCode.settings.json not parsing.
  • Clicking the status item opens or switches to the log tab.
  • The crash path: an unhandled exception is logged and the path printed after shutdown.

Out of scope

  • A Settings option for the log level or location.
  • An Output panel, log channels, or filtering by level.
  • Pointing at the error inside the settings file (squiggles).
  • Sending logs or crash reports anywhere.
  • New log calls beyond the failures listed above, or any Information/Debug logging.
  • Hover highlights or tooltips on the status bar.

Activity

  1. a-team-app commented on Oct 8, 2026

    @a-team-app
    ContributorAuthor

    Blocked by #442: Terminal.Gui 2.5 rewrites how settings load, which is where these warnings go

  2. a-team-app commented on Oct 9, 2026

    @a-team-app
    ContributorAuthor

    Draft PR #493 is up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions