Fix ghostty performance. Improve keyboard and input mode handling
This commit is contained in:
@@ -137,6 +137,8 @@ final class WorkspaceControllerTests: XCTestCase {
|
||||
controller.newTab()
|
||||
|
||||
XCTAssertEqual(factory.requestedDirectories, [nil, "/tmp/Raycast"])
|
||||
XCTAssertEqual(factory.requestedBackends, [.ghostty, .ghostty])
|
||||
XCTAssertEqual(factory.requestedTermTypes, [.automatic, .automatic])
|
||||
XCTAssertEqual(controller.activeTab?.currentDirectory, "/tmp/Raycast")
|
||||
XCTAssertEqual(controller.tabs.count, 2)
|
||||
XCTAssertEqual(controller.activeTabIndex, 1)
|
||||
@@ -191,13 +193,22 @@ private final class InMemoryWorkspaceStore: WorkspaceStoreType {
|
||||
}
|
||||
|
||||
private final class TestSettingsProvider: TerminalSessionConfigurationProviding {
|
||||
let terminalSessionConfiguration = TerminalSessionConfiguration(fontSize: 13, theme: .terminalApp, shellPath: "", scrollbackLines: 500)
|
||||
let terminalSessionConfiguration = TerminalSessionConfiguration(
|
||||
fontSize: 13,
|
||||
theme: .terminalApp,
|
||||
shellPath: "",
|
||||
scrollbackLines: 500,
|
||||
backendPreference: .ghostty,
|
||||
termTypePreference: .automatic
|
||||
)
|
||||
let hotkeySettings = AppSettings.default.hotkeys
|
||||
let terminalSizePresets = TerminalSizePresetStore.loadDefaults()
|
||||
}
|
||||
|
||||
private final class RecordingTerminalSessionFactory: TerminalSessionFactoryType {
|
||||
private(set) var requestedDirectories: [String?] = []
|
||||
private(set) var requestedBackends: [TerminalBackendPreference] = []
|
||||
private(set) var requestedTermTypes: [TerminalTermTypePreference] = []
|
||||
|
||||
@MainActor
|
||||
func makeSession(
|
||||
@@ -205,14 +216,20 @@ private final class RecordingTerminalSessionFactory: TerminalSessionFactoryType
|
||||
theme: TerminalTheme,
|
||||
shellPath: String,
|
||||
scrollbackLines: Int,
|
||||
backendPreference: TerminalBackendPreference,
|
||||
termTypePreference: TerminalTermTypePreference,
|
||||
initialDirectory: String?
|
||||
) -> TerminalSession {
|
||||
requestedDirectories.append(initialDirectory)
|
||||
requestedBackends.append(backendPreference)
|
||||
requestedTermTypes.append(termTypePreference)
|
||||
return TerminalSession(
|
||||
fontSize: fontSize,
|
||||
theme: theme,
|
||||
shellPath: shellPath,
|
||||
scrollbackLines: scrollbackLines,
|
||||
backendPreference: backendPreference,
|
||||
termTypePreference: termTypePreference,
|
||||
initialDirectory: initialDirectory,
|
||||
startImmediately: false
|
||||
)
|
||||
@@ -226,8 +243,12 @@ private struct UnusedTerminalSessionFactory: TerminalSessionFactoryType {
|
||||
theme: TerminalTheme,
|
||||
shellPath: String,
|
||||
scrollbackLines: Int,
|
||||
backendPreference: TerminalBackendPreference,
|
||||
termTypePreference: TerminalTermTypePreference,
|
||||
initialDirectory: String?
|
||||
) -> TerminalSession {
|
||||
_ = backendPreference
|
||||
_ = termTypePreference
|
||||
fatalError("WorkspaceRegistryTests should not create live terminal sessions.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user