Merge pull request #2420 from manaflow-ai/task-remove-copy-on-select-ui
Remove copy-on-select setting and override
This commit is contained in:
commit
cfac18b501
4 changed files with 0 additions and 148 deletions
|
|
@ -47988,57 +47988,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"settings.app.copyOnSelect": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"en": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "Copy on Select"
|
||||
}
|
||||
},
|
||||
"ja": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "選択時にコピー"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings.app.copyOnSelect.subtitleOff": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"en": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "Selecting terminal text does not copy it to the system clipboard."
|
||||
}
|
||||
},
|
||||
"ja": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "ターミナルテキストを選択してもシステムのクリップボードにはコピーしません。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings.app.copyOnSelect.subtitleOn": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"en": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "Automatically copy selected terminal text to the system clipboard."
|
||||
}
|
||||
},
|
||||
"ja": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "選択したターミナルテキストをシステムのクリップボードに自動でコピーします。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings.app.paneFirstClickFocus": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
|
|
|
|||
|
|
@ -1379,21 +1379,11 @@ class GhosttyApp {
|
|||
}
|
||||
}
|
||||
|
||||
private func loadCopyOnSelectOverride(_ config: ghostty_config_t) {
|
||||
loadInlineGhosttyConfig(
|
||||
TerminalCopyOnSelectSettings.overrideConfigLine(),
|
||||
into: config,
|
||||
prefix: "cmux-copy-on-select",
|
||||
logLabel: "copy-on-select override"
|
||||
)
|
||||
}
|
||||
|
||||
private func loadDefaultConfigFilesWithLegacyFallback(_ config: ghostty_config_t) {
|
||||
ghostty_config_load_default_files(config)
|
||||
loadLegacyGhosttyConfigIfNeeded(config)
|
||||
ghostty_config_load_recursive_files(config)
|
||||
loadCmuxAppSupportGhosttyConfigIfNeeded(config)
|
||||
loadCopyOnSelectOverride(config)
|
||||
loadCJKFontFallbackIfNeeded(config)
|
||||
// cmux provides the terminal background via backgroundView (CALayer)
|
||||
// instead of the GPU full-screen bg pass, so the layer can provide
|
||||
|
|
|
|||
|
|
@ -3906,22 +3906,6 @@ enum CommandPaletteRenameSelectionSettings {
|
|||
}
|
||||
}
|
||||
|
||||
enum TerminalCopyOnSelectSettings {
|
||||
static let enabledKey = "terminalCopyOnSelectEnabled"
|
||||
static let defaultEnabled = false
|
||||
|
||||
static func isEnabled(defaults: UserDefaults = .standard) -> Bool {
|
||||
if defaults.object(forKey: enabledKey) == nil {
|
||||
return defaultEnabled
|
||||
}
|
||||
return defaults.bool(forKey: enabledKey)
|
||||
}
|
||||
|
||||
static func overrideConfigLine(defaults: UserDefaults = .standard) -> String {
|
||||
isEnabled(defaults: defaults) ? "copy-on-select = clipboard" : "copy-on-select = false"
|
||||
}
|
||||
}
|
||||
|
||||
enum CommandPaletteSwitcherSearchSettings {
|
||||
static let searchAllSurfacesKey = "commandPalette.switcherSearchAllSurfaces"
|
||||
static let defaultSearchAllSurfaces = false
|
||||
|
|
@ -4052,8 +4036,6 @@ struct SettingsView: View {
|
|||
@AppStorage(QuitWarningSettings.warnBeforeQuitKey) private var warnBeforeQuitShortcut = QuitWarningSettings.defaultWarnBeforeQuit
|
||||
@AppStorage(CommandPaletteRenameSelectionSettings.selectAllOnFocusKey)
|
||||
private var commandPaletteRenameSelectAllOnFocus = CommandPaletteRenameSelectionSettings.defaultSelectAllOnFocus
|
||||
@AppStorage(TerminalCopyOnSelectSettings.enabledKey)
|
||||
private var terminalCopyOnSelectEnabled = TerminalCopyOnSelectSettings.defaultEnabled
|
||||
@AppStorage(CommandPaletteSwitcherSearchSettings.searchAllSurfacesKey)
|
||||
private var commandPaletteSearchAllSurfaces = CommandPaletteSwitcherSearchSettings.defaultSearchAllSurfaces
|
||||
@AppStorage(ShortcutHintDebugSettings.alwaysShowHintsKey)
|
||||
|
|
@ -4175,19 +4157,6 @@ struct SettingsView: View {
|
|||
)
|
||||
}
|
||||
|
||||
private var terminalCopyOnSelectSubtitle: String {
|
||||
if terminalCopyOnSelectEnabled {
|
||||
return String(
|
||||
localized: "settings.app.copyOnSelect.subtitleOn",
|
||||
defaultValue: "Automatically copy selected terminal text to the system clipboard."
|
||||
)
|
||||
}
|
||||
return String(
|
||||
localized: "settings.app.copyOnSelect.subtitleOff",
|
||||
defaultValue: "Selecting terminal text does not copy it to the system clipboard."
|
||||
)
|
||||
}
|
||||
|
||||
private var selectedSidebarActiveTabIndicatorStyle: SidebarActiveTabIndicatorStyle {
|
||||
SidebarActiveTabIndicatorSettings.resolvedStyle(rawValue: sidebarActiveTabIndicatorStyle)
|
||||
}
|
||||
|
|
@ -4709,20 +4678,6 @@ struct SettingsView: View {
|
|||
|
||||
SettingsCardDivider()
|
||||
|
||||
SettingsCardRow(
|
||||
String(localized: "settings.app.copyOnSelect", defaultValue: "Copy on Select"),
|
||||
subtitle: terminalCopyOnSelectSubtitle
|
||||
) {
|
||||
Toggle("", isOn: $terminalCopyOnSelectEnabled)
|
||||
.labelsHidden()
|
||||
.controlSize(.small)
|
||||
.accessibilityLabel(
|
||||
String(localized: "settings.app.copyOnSelect", defaultValue: "Copy on Select")
|
||||
)
|
||||
}
|
||||
|
||||
SettingsCardDivider()
|
||||
|
||||
SettingsCardRow(
|
||||
String(localized: "settings.app.preferredEditor", defaultValue: "Open Files With"),
|
||||
subtitle: String(localized: "settings.app.preferredEditor.subtitle", defaultValue: "Command to open files on Cmd-click. Leave empty for system default.")
|
||||
|
|
@ -5893,9 +5848,6 @@ struct SettingsView: View {
|
|||
.onChange(of: notificationSoundCustomFilePath) { _, _ in
|
||||
refreshNotificationCustomSoundStatus()
|
||||
}
|
||||
.onChange(of: terminalCopyOnSelectEnabled) { _, _ in
|
||||
GhosttyApp.shared.reloadConfiguration(source: "settings.copy_on_select")
|
||||
}
|
||||
.onChange(of: browserInsecureHTTPAllowlist) { oldValue, newValue in
|
||||
// Keep draft in sync with external changes unless the user has local unsaved edits.
|
||||
if browserInsecureHTTPAllowlistDraft == oldValue {
|
||||
|
|
@ -6020,7 +5972,6 @@ struct SettingsView: View {
|
|||
showMenuBarExtra = MenuBarExtraSettings.defaultShowInMenuBar
|
||||
warnBeforeQuitShortcut = QuitWarningSettings.defaultWarnBeforeQuit
|
||||
commandPaletteRenameSelectAllOnFocus = CommandPaletteRenameSelectionSettings.defaultSelectAllOnFocus
|
||||
terminalCopyOnSelectEnabled = TerminalCopyOnSelectSettings.defaultEnabled
|
||||
commandPaletteSearchAllSurfaces = CommandPaletteSwitcherSearchSettings.defaultSearchAllSurfaces
|
||||
ShortcutHintDebugSettings.resetVisibilityDefaults()
|
||||
alwaysShowShortcutHints = ShortcutHintDebugSettings.defaultAlwaysShowHints
|
||||
|
|
|
|||
|
|
@ -584,44 +584,6 @@ final class GhosttyConfigTests: XCTestCase {
|
|||
XCTAssertFalse(TelemetrySettings.isEnabled(defaults: defaults))
|
||||
}
|
||||
|
||||
func testTerminalCopyOnSelectDefaultsToDisabledWhenUnset() {
|
||||
let suiteName = "cmux.tests.copy-on-select.\(UUID().uuidString)"
|
||||
guard let defaults = UserDefaults(suiteName: suiteName) else {
|
||||
XCTFail("Failed to create isolated user defaults suite")
|
||||
return
|
||||
}
|
||||
defer {
|
||||
defaults.removePersistentDomain(forName: suiteName)
|
||||
}
|
||||
|
||||
defaults.removeObject(forKey: TerminalCopyOnSelectSettings.enabledKey)
|
||||
|
||||
XCTAssertFalse(TerminalCopyOnSelectSettings.isEnabled(defaults: defaults))
|
||||
XCTAssertEqual(
|
||||
TerminalCopyOnSelectSettings.overrideConfigLine(defaults: defaults),
|
||||
"copy-on-select = false"
|
||||
)
|
||||
}
|
||||
|
||||
func testTerminalCopyOnSelectUsesClipboardOverrideWhenEnabled() {
|
||||
let suiteName = "cmux.tests.copy-on-select.\(UUID().uuidString)"
|
||||
guard let defaults = UserDefaults(suiteName: suiteName) else {
|
||||
XCTFail("Failed to create isolated user defaults suite")
|
||||
return
|
||||
}
|
||||
defer {
|
||||
defaults.removePersistentDomain(forName: suiteName)
|
||||
}
|
||||
|
||||
defaults.set(true, forKey: TerminalCopyOnSelectSettings.enabledKey)
|
||||
|
||||
XCTAssertTrue(TerminalCopyOnSelectSettings.isEnabled(defaults: defaults))
|
||||
XCTAssertEqual(
|
||||
TerminalCopyOnSelectSettings.overrideConfigLine(defaults: defaults),
|
||||
"copy-on-select = clipboard"
|
||||
)
|
||||
}
|
||||
|
||||
private func rgb255(_ color: NSColor) -> RGB {
|
||||
let srgb = color.usingColorSpace(.sRGB)!
|
||||
var red: CGFloat = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue