File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed
Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -443,15 +443,25 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
443443 // Listen for when color changes
444444 vscode . workspace . onDidChangeConfiguration (
445445 async ( e ) => {
446- if ( e && e . affectsConfiguration ( "workbench.colorTheme" ) ) {
446+ if ( e . affectsConfiguration ( "workbench.colorTheme" ) ) {
447447 // Sends latest theme name to webview
448448 await this . postMessageToWebview ( { type : "theme" , text : JSON . stringify ( await getTheme ( ) ) } )
449449 }
450+ if ( e . affectsConfiguration ( "workbench.fontAliasing" ) ) {
451+ const fontAliasingSetting = vscode . workspace . getConfiguration ( "workbench" ) . get ( "fontAliasing" )
452+ const fontAliasing = typeof fontAliasingSetting === "string" ? fontAliasingSetting : undefined
453+ await this . postMessageToWebview ( { type : "fontAliasing" , value : fontAliasing } )
454+ }
450455 } ,
451456 null ,
452457 this . disposables ,
453458 )
454459
460+ const initialFontAliasingSetting = vscode . workspace . getConfiguration ( "workbench" ) . get ( "fontAliasing" )
461+ const initialFontAliasing =
462+ typeof initialFontAliasingSetting === "string" ? initialFontAliasingSetting : undefined
463+ await this . postMessageToWebview ( { type : "fontAliasing" , value : initialFontAliasing } )
464+
455465 // If the extension is starting a new session, clear previous task state.
456466 await this . removeClineFromStack ( )
457467
Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ export interface ExtensionMessage {
6969 | "maxReadFileLine"
7070 | "fileSearchResults"
7171 | "toggleApiConfigPin"
72+ | "fontAliasing"
7273 text ?: string
74+ value ?: string
7375 action ?:
7476 | "chatButtonClicked"
7577 | "mcpButtonClicked"
Original file line number Diff line number Diff line change @@ -75,6 +75,17 @@ const App = () => {
7575 const { requestId, promptText } = message
7676 setHumanRelayDialogState ( { isOpen : true , requestId, promptText } )
7777 }
78+
79+ if ( message . type === "fontAliasing" ) {
80+ const value = message . value as string | undefined
81+ let smoothingValue = "unset" // Default to letting the browser decide
82+
83+ if ( value === "antialiased" || value === "subpixel-antialiased" || value === "none" ) {
84+ smoothingValue = value
85+ }
86+
87+ ; ( document . documentElement . style as any ) [ "webkitFontSmoothing" ] = smoothingValue
88+ }
7889 } ,
7990 [ switchTab ] ,
8091 )
Original file line number Diff line number Diff line change @@ -190,8 +190,7 @@ textarea:focus {
190190
191191html {
192192 height : 100% ;
193- -webkit-font-smoothing : antialiased;
194- -moz-osx-font-smoothing : grayscale;
193+ -webkit-font-smoothing : inherit;
195194}
196195
197196body {
You can’t perform that action at this time.
0 commit comments