fix crash when no font is seleccted

This commit is contained in:
neon443
2025-07-17 16:29:57 +01:00
parent 50d1aa02af
commit 2363d613bf
3 changed files with 3 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ class HostsManager: ObservableObject, @unchecked Sendable {
self.fonts = customFonts
userDefaults.synchronize()
self.selectedFont = userDefaults.string(forKey: "selectedFontName") ?? "Menlo"
self.selectedFont = userDefaults.string(forKey: "selectedFontName") ?? "SF Mono"
self.fontSize = CGFloat(userDefaults.double(forKey: "fontSize"))
}

View File

@@ -23,6 +23,7 @@ struct TextBox: View {
} else {
TextField("", text: $text, prompt: Text(prompt))
.multilineTextAlignment(.trailing)
.disableAutocorrection(true)
}
}
}

View File

@@ -25,7 +25,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
if window != nil {
restoreScrollback()
if let hostsManager {
// font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
}
applySelectedTheme()
startFeedLoop()