diff --git a/Blink/Commands/mosh/mosh.swift b/Blink/Commands/mosh/mosh.swift index ec4ae335b..89414df3b 100644 --- a/Blink/Commands/mosh/mosh.swift +++ b/Blink/Commands/mosh/mosh.swift @@ -86,6 +86,7 @@ enum MoshError: Error, LocalizedError { let stateCallback: mosh_state_callback = { (context, buffer, size) in guard let buffer = buffer, let context = context else { + //print("Mosh returned with no encoded state.") return } let data = Data(bytes: buffer, count: size) @@ -110,12 +111,14 @@ enum MoshError: Error, LocalizedError { } @objc public override func main(_ argc: Int32, argv: Argv) -> Int32 { + //print("mosh main") mcpSession.setActiveSession() self.currentRunLoop = RunLoop.current // In ObjC, sessionParams is a covariable for MoshParams. // In Swift we need to cast. if let initialMoshParams = self.sessionParams as? MoshParams, let _ = initialMoshParams.encodedState { + //print("Init mosh from Params") return moshMain(initialMoshParams) } else { let command: MoshCommand @@ -241,6 +244,8 @@ enum MoshError: Error, LocalizedError { } private func moshMain(_ moshParams: MoshParams) -> Int32 { + //print("moshMain active") + let originalRawMode = device.rawMode self.device.rawMode = true diff --git a/Blink/SpaceController.swift b/Blink/SpaceController.swift index 2df0d6fdf..7e2b77fff 100644 --- a/Blink/SpaceController.swift +++ b/Blink/SpaceController.swift @@ -583,9 +583,11 @@ extension SpaceController: UIPageViewControllerDelegate { else { return } + termController.resumeIfNeeded() _currentKey = termController.meta.key _displayHUD() _attachInputToCurrentTerm() + } } diff --git a/Blink/TermController.swift b/Blink/TermController.swift index f09ee6e6f..b33b6c332 100644 --- a/Blink/TermController.swift +++ b/Blink/TermController.swift @@ -236,11 +236,6 @@ class TermController: UIViewController { view.setNeedsLayout() } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated); - resumeIfNeeded() - } - public override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews()