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

Unable to display correctly special characters like graph lines in Terminals #468

Open
Dando-Real-ITA opened this issue Sep 9, 2022 · 1 comment

Comments

@Dando-Real-ITA
Copy link

Hi, I am using version 3.14.0 and I am unable to view correctly characters like lines in a graph:
image

This is a view from a normal ssh terminal:
image

Output of locale:

LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

and $LANG is C.UTF-8

Also when using tmux, the bottom status bar has problems rendering, for example it "piles up" showing multiple times like here:
image

@Dando-Real-ITA
Copy link
Author

I did more testing, and seems to be related to the way GSON handles data in java side.

For example, testing input by sending is correctly encoded in javascript by JSON.stringify, then is send as binary data via connection.send.
However the terminal output displays a "?"

And writing in the terminal: printf "\u1EA1\n" and executing, deliveres to javascript an e.data already broken (notice the ��� instead of ):

[{"sessionId":75,"output":"\r\n\u001b[?2004l\r���\r\n\u001b[?2004h\u001b]0;ubuntu@gpu01: ~\u0007\u001b[01;32mubuntu@gpu01\u001b[00m:\u001b[01;34m~\u001b[00m$ ","id":1,"displayNm":"gpu01.ashburn","user":"ubuntu","host":"gpu01.ashburn.poc.oraclevp.com","port":22,"authorizedKeys":"~/.ssh/authorized_keys","checked":false,"statusCd":"INITIAL","instanceId":1}]

Maybe could be related for output to using sendText instead of sendBinary here:

this.session.getBasicRemote().sendText(json);

And for input, here:

public void onMessage(String message) {

It is accepting onMessage String which is UTF-16, instead of binary to be decoded as UTF-8 with StandardCharsets.UTF_8 before parsing with GSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant