add showCursorImmediately option
This commit is contained in:
@@ -18,6 +18,19 @@ describe('CoreService', () => {
|
|||||||
new MockOptionsService());
|
new MockOptionsService());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('isCursorInitialized', () => {
|
||||||
|
it('should be false by default', () => {
|
||||||
|
assert.equal(coreService.isCursorInitialized, false);
|
||||||
|
});
|
||||||
|
it('should be true when showCursorImmediately is true', () => {
|
||||||
|
const coreServiceWithOption = new CoreService(
|
||||||
|
new MockBufferService(80, 30),
|
||||||
|
new MockLogService(),
|
||||||
|
new MockOptionsService({ showCursorImmediately: true }));
|
||||||
|
assert.equal(coreServiceWithOption.isCursorInitialized, true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('reset', () => {
|
describe('reset', () => {
|
||||||
it('should not affect isCursorInitialized', () => {
|
it('should not affect isCursorInitialized', () => {
|
||||||
coreService.isCursorInitialized = true;
|
coreService.isCursorInitialized = true;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const DEFAULT_KITTY_KEYBOARD_STATE = (): IKittyKeyboardState => ({
|
|||||||
export class CoreService extends Disposable implements ICoreService {
|
export class CoreService extends Disposable implements ICoreService {
|
||||||
public serviceBrand: any;
|
public serviceBrand: any;
|
||||||
|
|
||||||
public isCursorInitialized: boolean = false;
|
public isCursorInitialized: boolean;
|
||||||
public isCursorHidden: boolean = false;
|
public isCursorHidden: boolean = false;
|
||||||
public modes: IModes;
|
public modes: IModes;
|
||||||
public decPrivateModes: IDecPrivateModes;
|
public decPrivateModes: IDecPrivateModes;
|
||||||
@@ -59,6 +59,7 @@ export class CoreService extends Disposable implements ICoreService {
|
|||||||
@IOptionsService private readonly _optionsService: IOptionsService
|
@IOptionsService private readonly _optionsService: IOptionsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
this.isCursorInitialized = _optionsService.rawOptions.showCursorImmediately ?? false;
|
||||||
this.modes = clone(DEFAULT_MODES);
|
this.modes = clone(DEFAULT_MODES);
|
||||||
this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);
|
this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);
|
||||||
this.kittyKeyboard = DEFAULT_KITTY_KEYBOARD_STATE();
|
this.kittyKeyboard = DEFAULT_KITTY_KEYBOARD_STATE();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { Emitter } from 'vs/base/common/event';
|
|||||||
export const DEFAULT_OPTIONS: Readonly<Required<ITerminalOptions>> = {
|
export const DEFAULT_OPTIONS: Readonly<Required<ITerminalOptions>> = {
|
||||||
cols: 80,
|
cols: 80,
|
||||||
rows: 24,
|
rows: 24,
|
||||||
|
showCursorImmediately: false,
|
||||||
cursorBlink: false,
|
cursorBlink: false,
|
||||||
cursorStyle: 'block',
|
cursorStyle: 'block',
|
||||||
cursorWidth: 1,
|
cursorWidth: 1,
|
||||||
|
|||||||
@@ -253,6 +253,7 @@ export interface ITerminalOptions {
|
|||||||
rescaleOverlappingGlyphs?: boolean;
|
rescaleOverlappingGlyphs?: boolean;
|
||||||
rightClickSelectsWord?: boolean;
|
rightClickSelectsWord?: boolean;
|
||||||
rows?: number;
|
rows?: number;
|
||||||
|
showCursorImmediately?: boolean;
|
||||||
screenReaderMode?: boolean;
|
screenReaderMode?: boolean;
|
||||||
scrollback?: number;
|
scrollback?: number;
|
||||||
scrollOnUserInput?: boolean;
|
scrollOnUserInput?: boolean;
|
||||||
|
|||||||
Vendored
+7
@@ -252,6 +252,13 @@ declare module '@xterm/headless' {
|
|||||||
* The number of rows in the terminal.
|
* The number of rows in the terminal.
|
||||||
*/
|
*/
|
||||||
rows?: number;
|
rows?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show the cursor immediately when the terminal is created.
|
||||||
|
* When false (default), the cursor will not be visible until the terminal
|
||||||
|
* is focused for the first time.
|
||||||
|
*/
|
||||||
|
showCursorImmediately?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Vendored
+7
@@ -340,6 +340,13 @@ declare module '@xterm/xterm' {
|
|||||||
* The number of rows in the terminal.
|
* The number of rows in the terminal.
|
||||||
*/
|
*/
|
||||||
rows?: number;
|
rows?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show the cursor immediately when the terminal is created.
|
||||||
|
* When false (default), the cursor will not be visible until the terminal
|
||||||
|
* is focused for the first time.
|
||||||
|
*/
|
||||||
|
showCursorImmediately?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user