Skip to content

Set serial monitor font from terminal.integrated.fontSize#65

Open
connorajersch wants to merge 1 commit into
Jason2866:mainfrom
connorajersch:main
Open

Set serial monitor font from terminal.integrated.fontSize#65
connorajersch wants to merge 1 commit into
Jason2866:mainfrom
connorajersch:main

Conversation

@connorajersch

@connorajersch connorajersch commented Jun 26, 2026

Copy link
Copy Markdown

This might be an opinionated change, but I personally like to have my terminal set to a different font size than my editior. VSCode allows users to set their integrated terminal font size with the terminal.integrated.fontSize setting. This implementation should update the font size live if changed while using it.

Not sure if this is something that others would find useful, but figured I would submit the changes anyways.

Summary by CodeRabbit

  • New Features

    • The terminal output in the extension now updates its font size automatically when VS Code’s terminal font size setting changes.
    • Font size changes are reflected live in the webview without needing to reload or reopen the panel.
  • Bug Fixes

    • Improved consistency between the editor’s terminal font size setting and the displayed serial output.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1db30f4b-3fb9-40af-a37f-045817da09f1

📥 Commits

Reviewing files that changed from the base of the PR and between e36c339 and 8eb7560.

📒 Files selected for processing (2)
  • src/extension.ts
  • src/webviewPanel.ts

📝 Walkthrough

Walkthrough

The PR adds live syncing for terminal.integrated.fontSize between the extension and the webview, initializes the serial output font size from the current VS Code setting, and updates the webview CSS variable when the setting changes.

Changes

Live serial font-size sync

Layer / File(s) Summary
Configuration change hook
src/extension.ts
onDidChangeConfiguration detects terminal.integrated.fontSize updates and calls viewProvider.updateTerminalFontSize() when the panel exists.
Initial font-size render
src/webviewPanel.ts
getHtmlContent() reads terminal.integrated.fontSize, initializes --serial-font-size, and applies that variable to the serial output CSS.
Runtime webview update
src/webviewPanel.ts
updateTerminalFontSize() posts fontSizeChanged, and the webview message handler updates --serial-font-size at runtime.

Sequence Diagram(s)

sequenceDiagram
  participant "VS Code Settings"
  participant "src/extension.ts"
  participant "EspDecoderWebviewPanel"
  participant "webview message handler"
  "VS Code Settings"->>"src/extension.ts": terminal.integrated.fontSize changes
  "src/extension.ts"->>"EspDecoderWebviewPanel": updateTerminalFontSize()
  "EspDecoderWebviewPanel"->>"webview message handler": postMessage(fontSizeChanged)
  "webview message handler"->>"webview message handler": set --serial-font-size
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Jason2866/ESP-Decoder#12: Both PRs touch the same EspDecoderWebviewPanel/src/extension.ts flow for webview behavior, and this one extends it with live terminal font-size synchronization.

Poem

🐇 My whiskers twitch, my terminal hums,
The font size hops when setting comes.
A nibble here, a CSS shim there,
Now serial text fits bunny-sized care.
Thump! thump! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: using terminal.integrated.fontSize for the serial monitor font.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant