From e77eb04fd56cd81df522ee9e4f9dda8121f08522 Mon Sep 17 00:00:00 2001 From: Arup Chauhan Date: Sun, 25 Aug 2024 18:41:31 -0500 Subject: [PATCH] Working on fixing Issue #3293 Signed-off-by: Arup Chauhan --- .hintrc | 8 +++++++ src/browser/public/Terminal.ts | 5 +++++ src/common/InputHandler.ts | 4 ++++ test_file.html | 38 ++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 .hintrc create mode 100644 test_file.html diff --git a/.hintrc b/.hintrc new file mode 100644 index 0000000000..cb34607dff --- /dev/null +++ b/.hintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "development" + ], + "hints": { + "no-inline-styles": "off" + } +} \ No newline at end of file diff --git a/src/browser/public/Terminal.ts b/src/browser/public/Terminal.ts index 3b4309437f..2ce3d17800 100644 --- a/src/browser/public/Terminal.ts +++ b/src/browser/public/Terminal.ts @@ -35,6 +35,11 @@ export class Terminal extends Disposable implements ITerminalApi { this._core = this._register(new TerminalCore(options)); this._addonManager = this._register(new AddonManager()); + // Store user's cursor style + this._core.options.userCursorStyle = this._core.options.cursorStyle; + + + this._publicOptions = { ... this._core.options }; const getter = (propName: string): any => { return this._core.options[propName]; diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index b94d785544..00c3906ca6 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -2734,6 +2734,10 @@ export class InputHandler extends Disposable implements IInputHandler { public setCursorStyle(params: IParams): boolean { const param = params.params[0] || 1; switch (param) { + case 0: + console.log('Case 0 triggerd'); + this._optionsService.options.cursorStyle = this._optionsService.options.userCursorStyle || 'block'; + break; case 1: case 2: this._optionsService.options.cursorStyle = 'block'; diff --git a/test_file.html b/test_file.html new file mode 100644 index 0000000000..3bcf1525f8 --- /dev/null +++ b/test_file.html @@ -0,0 +1,38 @@ + + + + + + xterm.js Test + + + + + +
+ +