 		if self.window != nil {
 			windowSetCall?()
 		}
+		windowSetCall = nil
 	}
 }
 

class OutputTabController: NSTabViewController, OutputHandler, ToolbarItemHandler {
	// MARK: properties
	var currentOutputController: OutputController!
	var consoleController: ConsoleOutputController?
	var imageController: ImageOutputController?
	var webController: WebKitOutputController?
	var helpController: HelpOutputController?
	var imageCache: ImageCache? { return sessionController?.session.imageCache }
	weak var sessionController: SessionController? { didSet { sessionControllerUpdated() } }
	weak var displayedFile: AppFile?

		super.viewWillAppear()
		guard consoleController == nil else { return }
		consoleController = firstChildViewController(self)
		consoleController?.viewFileOrImage = { [weak self] (fw) in self?.displayAttachment(fw) }
		imageController = firstChildViewController(self)
		imageController?.imageCache = imageCache
		webController = firstChildViewController(self)
