Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some control sequences are not rendered properly #1204

Closed
zolem opened this issue Jan 11, 2018 · 7 comments
Closed

Some control sequences are not rendered properly #1204

zolem opened this issue Jan 11, 2018 · 7 comments

Comments

@zolem
Copy link

zolem commented Jan 11, 2018

I am not an expert in parsing out ansi control sequences but I did notice there were a few that seemed to just pop up as the missing character.

Here is a screenshot of what I am talking about
image

image

At the moment I am testing with some logged data from the server that I have pasted below:


������

�[1m�[31m__        __   _
�[1m�[31m\ \      / /__| | ___ ___  _ __ ___   ___
�[1m�[31m \ \ /\ / / _ \ |/ __/ _ \| '_ ` _ \ / _ \
�[1m�[31m  \ V  V /  __/ | (_| (_) | | | | | |  __/
�[1m�[31m   \_/\_/ \___|_|\___\___/|_| |_| |_|\___|
�[1m�[35m ****     ****                         �[1m�[31m| |_ ___ �[1m�[35m**   **
�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m/�[1m�[35m**   **�[0;37;40m�[34m/�[1m�[35m**                         �[1m�[31m| __/   \�[1m�[35m**  �[0;37;40m�[34m/�[1m�[35m**
�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m//�[1m�[35m** **�[0;37;40m�[34m /�[1m�[35m**  *****  ****** *****  **�[1m�[31m| || ( ) |�[1m�[35m***�[0;37;40m�[34m/�[1m�[35m**       ******
�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m //�[1m�[35m***�[0;37;40m�[34m  /�[1m�[35m** **�[0;37;40m�[34m///�[1m�[35m**�[0;37;40m�[34m//�[1m�[35m**�[0;37;40m�[34m//�[1m�[35m***�[0;37;40m�[34m///�[1m�[35m**�[0;37;40m�[34m//�[1m�[35m**�[1m�[31m\__\___/�[1m�[35m**�[0;37;40m�[34m/ /�[1m�[35m******  �[0;37;40m�[34m//////�[1m�[35m**
�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m  //�[1m�[35m*�[0;37;40m�[34m   /�[1m�[35m**�[0;37;40m�[34m/�[1m�[35m*******�[0;37;40m�[34m /�[1m�[35m** �[0;37;40m�[34m//�[1m�[35m*******�[0;37;40m�[34m /�[1m�[35m**�[0;37;40m�[34m  /�[1m�[35m**�[0;37;40m�[34m  /�[1m�[35m**  �[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m///�[1m�[35m**  *******
�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m   /    /�[1m�[35m**�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m////  /�[1m�[35m**  �[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m////  /�[1m�[35m**�[0;37;40m�[34m  /�[1m�[35m**�[0;37;40m�[34m  /�[1m�[35m**  �[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m  /�[1m�[35m** **�[0;37;40m�[34m////�[1m�[35m**
�[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m        /�[1m�[35m**�[0;37;40m�[34m//�[1m�[35m******�[0;37;40m�[34m/�[1m�[35m***  �[0;37;40m�[34m//�[1m�[35m****** ***�[0;37;40m�[34m  /�[1m�[35m**�[0;37;40m�[34m  //�[1m�[35m** �[0;37;40m�[34m/�[1m�[35m**�[0;37;40m�[34m  /�[1m�[35m**�[0;37;40m�[34m//�[1m�[35m********
�[0;37;40m�[34m//         //  ////// ///    ////// ///   //    //  //   //  ////////

�[1m�[37m           Driver: MudOS v22.1b23    Mudlib: Merentha/NM MM-2.03 
�[1m�[37m     <<<  Visit the Merentha web page at http://www.merentha.com  >>>
		�[1m�[37mThere are currently 15 adventurers playing

�[0;37;40m�[32mWhat name do you wish?�[0;37;40m 

    �[1m�[32m*-=-=-=-=-=-=-=-=-=-=-=-| �[35mWelcome Back�[32m |-=-=-=-=-=-=-=-=-=-=-=-*
    | �[35mA character by the name Zolem has already been               �[32m|
    | �[35mcreated in Merentha.                                         �[32m|
    |                                                              �[32m|
    | �[35mIf this is not your character disconnect and reconnect with  �[32m|
    | �[35ma new name.  You can disconnect by hitting <enter> at the    �[32m|
    | �[35mpassword prompt without entering a password.                 �[32m|
    *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*

�[0;37;40m�[32mWelcome Back!
Please enter your password: ���
��� 
�[0;37;40m        >>> Terminal currently set to ansi <<<
�[0;37;40m�[0;37;40m�[32m*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| �[1m�[35mNews �[0;37;40m�[32m|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
�[1m�[33m  THE RULES:

Details

  • Electron:
  • Windows 10:
  • xterm.js 3.1:
@Tyriar
Copy link
Member

Tyriar commented Jan 12, 2018

You can see what's being sent to xterm.js by turning on debug mode:

term.setOption('debug', true);

This will output what's happening to the console. If you can narrow down the particular parts that are failing we can probably identify the issue.

@zolem
Copy link
Author

zolem commented Jan 13, 2018

Thanks for responding. I actually looked through the code and I noticed that the 3 control sequences are on the escape sequences file but i didnt see them actually being used anywhere. Im on my phone at the moment but if I recall they are SOH, US, and CAN. There are some other characters in between but idk what those are. I would offer to do a pull request if someone has a reference to what those are supposed to do. I know CAN is cancel, but I dont know how xterm is supposed to interpret that. Does it just delete the entire line just preceding characters? When I get that same data on actual xterm the entire first line just doesnt render.

@Tyriar
Copy link
Member

Tyriar commented Jan 15, 2018

SOH, US and CAN don't seem to be in this document which I essentially treat as a spec http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Also I'm not sure what this escape sequences file to which you are referring. Did you see the output generated by debug mode xterm.js just before the ascii welcome is printed?

@zolem
Copy link
Author

zolem commented Jan 15, 2018

Here are the lines of code I am refering to:

export const SOH = '\x01';

export const US = '\x1f';

Looks like CAN is used by the parser so I am not sure why it doesn't do whatever it is supposed to do. Or maybe it is and there are just other characters with problems.

export const CAN = '\x18';

escapedStateHandler[C0.CAN] = (parser) => parser.setState(ParserState.NORMAL);

csiParamStateHandler[C0.CAN] = (parser) => parser.setState(ParserState.NORMAL);

csiStateHandler[C0.CAN] = (handler, params, prefix, postfix, parser) => parser.setState(ParserState.NORMAL);

When I run debug and only push the lines in question it just returns the line and then undefined.

image

image

NP++ shows the lines like this:
image

image

@Tyriar
Copy link
Member

Tyriar commented Jan 18, 2018

For the password but there are 2 characters followed by SOH. Those 2 characters appear to be getting renderers, I kind of expect this? Does this happen with other terminals?

@zolem
Copy link
Author

zolem commented Jan 18, 2018

In the new windows bash if I connect to the game there are no weird characters at all. Clearly everything is being interpreted to do something.
image

image

@Tyriar
Copy link
Member

Tyriar commented Jun 8, 2018

This is likely the root cause of #1461, let's close it in favor of that for easier tracking.

@Tyriar Tyriar closed this as completed Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants