vibetunnel/ios/VibeTunnel/Models/TerminalRenderer.swift
Peter Steinberger baaaa5a033 fix: CI and linting issues across all platforms
- Fix code signing in Mac and iOS test workflows
- Fix all SwiftFormat and SwiftLint issues
- Fix ESLint issues in web code
- Remove force casts and unwrapping in Swift code
- Update build scripts to use correct file paths
2025-06-23 19:40:53 +02:00

40 lines
1.1 KiB
Swift

import Foundation
/// Available terminal renderer implementations
enum TerminalRenderer: String, CaseIterable, Codable {
case swiftTerm = "SwiftTerm"
case xterm = "xterm.js"
var displayName: String {
switch self {
case .swiftTerm:
"SwiftTerm (Native)"
case .xterm:
"xterm.js (WebView)"
}
}
var description: String {
switch self {
case .swiftTerm:
"Native Swift terminal emulator with best performance"
case .xterm:
"JavaScript-based terminal, identical to web version"
}
}
/// The currently selected renderer (persisted in UserDefaults)
static var selected: Self {
get {
if let rawValue = UserDefaults.standard.string(forKey: "selectedTerminalRenderer"),
let renderer = Self(rawValue: rawValue)
{
return renderer
}
return .swiftTerm // Default
}
set {
UserDefaults.standard.set(newValue.rawValue, forKey: "selectedTerminalRenderer")
}
}
}