Skip to content

Commit 92d03dc

Browse files
committed
Colors/Font now update instantly
1 parent 953186a commit 92d03dc

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

CodeEditModules/Modules/TerminalEmulator/src/TerminalEmulatorView.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,23 +128,16 @@ public struct TerminalEmulatorView: NSViewRepresentable {
128128
}
129129

130130
public func updateNSView(_ view: LocalProcessTerminalView, context: Context) {
131-
print("Update view")
132-
// if exited {
133-
// setupSession()
134-
// }
135-
// // if view.font != font { // Fixes Memory leak
136-
// // TODO: Fix memory leak
137-
// // for some reason setting the font here causes a memory leak.
138-
// // I'll leave it for now since the colors won't change
139-
// // without setting the font which is weird
140-
// view.font = font
141-
// // }
131+
if view.font != font { // Fixes Memory leak
132+
view.font = font
133+
}
142134
view.configureNativeColors()
143135
view.installColors(self.appearanceColors)
144136
if TerminalEmulatorView.lastTerminal != nil {
145137
TerminalEmulatorView.lastTerminal = view
146138
}
147139
view.getTerminal().softReset()
140+
view.feed(text: "") // send empty character to force colors to be redrawn
148141
}
149142

150143
public func makeCoordinator() -> Coordinator {

0 commit comments

Comments
 (0)