Move handler into CoreService and adopt

This also fine tunes some of the data events to not clear selection
and scroll to the bottom of the viewport anymore.

Part of #1507
Fixes #2112
This commit is contained in:
Daniel Imms
2019-06-23 10:10:17 -07:00
parent 94a2ad9416
commit bfa7a2df76
12 changed files with 153 additions and 80 deletions
+7 -1
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { IBufferService, IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'common/services/Services';
import { IBufferService, ICoreService, IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'common/services/Services';
import { IEvent, EventEmitter } from 'common/EventEmitter';
import { clone } from 'common/Clone';
import { DEFAULT_OPTIONS } from 'common/services/OptionsService';
@@ -27,6 +27,12 @@ export class MockBufferService implements IBufferService {
reset(): void {}
}
export class MockCoreService implements ICoreService {
onData: IEvent<string> = new EventEmitter<string>().event;
onUserInput: IEvent<void> = new EventEmitter<void>().event;
triggerDataEvent(data: string, wasUserInput?: boolean): void {}
}
export class MockOptionsService implements IOptionsService {
options: ITerminalOptions = clone(DEFAULT_OPTIONS);
onOptionChange: IEvent<string> = new EventEmitter<string>().event;