You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warnings go to a log you open with Show log, and the status bar counts the ones you haven't seen #473
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.
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
⚠ ncount in the status bar until you've looked. Pitch: #92.Depends on #442 (Terminal.Gui 2.5), which rewrites how
DefaultSettingsServiceloads settings, the code this task adds warnings to.Acceptance criteria
~/.tui/TuiCode.settings.jsonand start TuiCode: the status bar's message readsTuiCode.settings.json has an error, so defaults are in use. sl shows the log, and⚠ 1shows on the status bar's right side, beforeLn, Col, in the theme's warning colour.⚠ 1stays.sl) is in the command palette and in the Help menu, below Show diagnostics. It has no default key.slopens~/.tui/logs/TuiCode.logas an ordinary editor tab, which can be searched and copied from. If it's already open,slswitches to it.⚠. A new warning brings it back with a new count.⚠ 1, icon or count, does the same assl.~/.tui/grammarsthat 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⚠.TuiCode.1.log; older ones are gone.TuiCode crashed. Details: ~/.tui/logs/TuiCode.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
TuiCode.1.logand deleting older ones.TuiCode.settings.jsonnot parsing.Out of scope