 
     self.unsortedScoredUrls.removeAll()
     self.searchField.stringValue = ""
+    self.perSessionDisposeBag = DisposeBag()
   }
 
   func windowDidResignKey(_: Notification) { self.window.performClose(self) }

    self.cwdPathCompsCount = cwd.pathComponents.count
    self.cwdControl.url = cwd

    self.searchField.rx
      .text.orEmpty
      .throttle(.milliseconds(1 * 500), latest: true, scheduler: MainScheduler.instance)
      .distinctUntilChanged()
      .observeOn(MainScheduler.instance)
      .subscribe(onNext: { [weak self] pattern in
        guard let fileService = self?.fileServicesPerRootUrl[cwd] else { return }
        self?.scanAndScore(pattern, with: fileService)
      })
      .disposed(by: self.disposeBag)

    self.windowController.showWindow(self)
  }

  private let emit: (Action) -> Void
  private let disposeBag = DisposeBag()

  private let searchStream: Observable<String>
  private var perSessionDisposeBag = DisposeBag()
  private var cwdPathCompsCount = 0
  private var usesVcsIgnores = true
  private var scanToken = Token()
