xterm.js icon indicating copy to clipboard operation
xterm.js copied to clipboard

Working on fixing Issue #3293

Open arup-chauhan opened this issue 1 year ago • 0 comments

@Tyriar Hi, I was working on #3293 and for that I have done the following things and created this draft PR to discuss.

Here are some changes I made:

  1. Terminal.ts:

    • I added logic to save the custom cursor style (userCursorStyle) when the terminal initializes. This ensures that the terminal keeps my preferred cursor style even when control sequences are sent.
  2. InputHandler.ts:

    • I adjusted the setCursorStyle function to apply userCursorStyle when handling the reset cursor style sequence (\x1b[0 q). I also included some console log statements to help debug the cursor style changes.

Possible Issue with Control Sequences:

While testing, I noticed something off with how the control sequences are being processed. Specifically, the output logs don't match the expected behavior.

Current Log Outputs:

Script is running
User Cursor Style: underline
DOM fully loaded and parsed
Sending control sequence as given 1
User Cursor Style: underline
Current Style: underline
Sending control sequence as given 2
User Cursor Style: underline
Current cursor style: underline

Expected Log Outputs:

Script is running
User Cursor Style: underline
DOM fully loaded and parsed
Sending control sequence as given 1
User Cursor Style: underline
Current Style: bar
Sending control sequence as given 2
User Cursor Style: underline
Current cursor style: underline

Am I testing / emulating the xterm terminal properly? The current output suggests that the control sequences may not be applied correctly, particularly when resetting the cursor style. This might need a closer look to figure out what's going on.

Help would be appreciated.

arup-chauhan avatar Aug 25 '24 23:08 arup-chauhan