Skip to content

Commit 312c451

Browse files
committed
Fix Theming, Fix Copy
1 parent 931afb2 commit 312c451

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CodeEdit/Features/TerminalEmulator/Views/CETerminalView.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ class CETerminalView: TerminalView {
1616
super.setFrameSize(newSize)
1717
}
1818
}
19+
20+
@objc
21+
override open func copy(_ sender: Any) {
22+
let range = selectedPositions()
23+
let text = terminal.getText(start: range.start, end: range.end)
24+
let pasteboard = NSPasteboard.general
25+
pasteboard.clearContents()
26+
pasteboard.setString(text, forType: .string)
27+
}
1928
}

CodeEdit/Features/TerminalEmulator/Views/TerminalEmulatorView.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,12 @@ struct TerminalEmulatorView: NSViewRepresentable {
180180
terminal.appearance = colorAppearance
181181
scroller(terminal)?.isHidden = true
182182
terminal.font = font
183-
terminal.configureNativeColors()
184183
terminal.installColors(self.colors)
185184
terminal.caretColor = cursorColor.withAlphaComponent(0.5)
186185
terminal.caretTextColor = cursorColor.withAlphaComponent(0.5)
187186
terminal.selectedTextBackgroundColor = selectionColor
188-
// terminal.nativeForegroundColor = textColor
189-
// terminal.nativeBackgroundColor = terminalSettings.useThemeBackground ? backgroundColor : .clear
187+
terminal.nativeForegroundColor = textColor
188+
terminal.nativeBackgroundColor = terminalSettings.useThemeBackground ? backgroundColor : .clear
190189
terminal.cursorStyleChanged(source: terminal.getTerminal(), newStyle: getTerminalCursor())
191190
terminal.layer?.backgroundColor = CGColor.clear
192191
terminal.optionAsMetaKey = optionAsMeta
@@ -202,13 +201,12 @@ struct TerminalEmulatorView: NSViewRepresentable {
202201
}
203202

204203
func updateNSView(_ view: CELocalShellTerminalView, context: Context) {
205-
view.configureNativeColors()
206204
view.installColors(self.colors)
207205
view.caretColor = cursorColor.withAlphaComponent(0.5)
208206
view.caretTextColor = cursorColor.withAlphaComponent(0.5)
209207
view.selectedTextBackgroundColor = selectionColor
210-
// view.nativeForegroundColor = textColor
211-
// view.nativeBackgroundColor = terminalSettings.useThemeBackground ? backgroundColor : .clear
208+
view.nativeForegroundColor = textColor
209+
view.nativeBackgroundColor = terminalSettings.useThemeBackground ? backgroundColor : .clear
212210
view.layer?.backgroundColor = .clear
213211
view.optionAsMetaKey = optionAsMeta
214212
view.cursorStyleChanged(source: view.getTerminal(), newStyle: getTerminalCursor())

0 commit comments

Comments
 (0)