mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-17 13:15:53 +00:00
- 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
40 lines
1.1 KiB
Swift
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")
|
|
}
|
|
}
|
|
}
|