Performance with hterm/Secure Shell extension

111 views
Skip to first unread message

Xiaohui Chen

unread,
Sep 14, 2022, 7:41:45 PM9/14/22
to chromium-hterm
Hi, 

I recently got my top of the line spec HP Dragonfly Chromebook.  The performance of this device is superb.  I really wanted to use this as my main device, but I quickly remembered the reasons I switched to a gLinux laptop last time. 

1. The font width issue makes my Vim look off.  This is fixable. I spent some time researching and this known issue can be worked around with web font. [1] 

2. The rendering performance is not great. I didn't find a fix for this. I can "feel" the few milliseconds delay between my keystroke and the character showing up.  With my tmux + vim setup, scrolling text in vim is painful.  I looked into the dev tools and it seems hterm is rendering everything with DOM elements.  I am sure tmux and vim is being difficult and making it re-render the whole thing every time.  But as a developer, I want my tools to be fast and delightful.  There are some prior art that moved from DOM based rendering and gained "5 to 45 times faster than before" [2]

Is there similar plan to optimize hterm? Or maybe consider switching to xterm.js?

Best,
Xiaohui


Joel Hockey

unread,
Sep 14, 2022, 8:11:50 PM9/14/22
to Xiaohui Chen, chromium-hterm
Yes, we have xterm.js supported as an alternative emulator, and it fixes the things you describe.  This is still a work in progress, but is usable from M107.  It requires enabling chrome://flags#terminal-alternative-emulator (maybe os://flags)

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-hter...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/9bd655d9-1c55-4d62-b0de-f2e809532e9fn%40chromium.org.

Joel Hockey

unread,
Sep 14, 2022, 8:19:07 PM9/14/22
to Xiaohui Chen, chromium-hterm
I should clarify that the xterm integration is only with the Terminal system app (search for "terminal" in launcher).  The Secure Shell Extension doesn't have any current plans to change from hterm.

Xiaohui Chen

unread,
Sep 14, 2022, 8:27:29 PM9/14/22
to chromium-hterm, Joel Hockey, chromium-hterm, Xiaohui Chen
Thanks Joel!  Assume xterm works well for Terminal system app, does it make sense to update Secure Shell Extension in the long run? 

Joel Hockey

unread,
Sep 14, 2022, 8:41:40 PM9/14/22
to Xiaohui Chen, chromium-hterm
Yes, xterm is working well in Terminal so far.  The main focus at the moment is getting pane support and tmux integration.

It is certainly possible for Secure Shell to also use xterm.js.  It would be a medium amount of work to integrate it (not huge, but not trivial).

The Terminal system app also supports SSH using the same underlying implementation as nassh (secure shell ext).

Xiaohui Chen

unread,
Sep 15, 2022, 2:53:08 PM9/15/22
to chromium-hterm, Joel Hockey, chromium-hterm, Xiaohui Chen
Do you mean the Terminal app can also connect to corp? 

Xiaohui Chen

unread,
Sep 15, 2022, 3:04:06 PM9/15/22
to chromium-hterm, Xiaohui Chen, Joel Hockey, chromium-hterm
To answer my own question, yes the Terminal system app now can be used as ssh client to connect to corp.  Thanks Joel! 

Valentyn Shybanov

unread,
Sep 27, 2022, 12:39:56 AM9/27/22
to chromium-hterm, Xiaohui Chen, Joel Hockey, chromium-hterm
Wow, Terminal is becoming better and better. But for me the deal-breaker is a possibility to change font to some custom one (with ligatures). I am using FiraCode and for hterm I used custom CCS to inject code like:

@import url(https://cdn.jsdelivr.net/gh/tonsky/FiraCode@4/distr/fira_code.css);

x-row {
    -webkit-font-feature-settings: "liga" on, "calt" on;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-family: 'Fira Code';
    font-variant-ligatures: normal;
}

But, as I understand, it's not possible to do with Terminal :( 

Joel Hockey

unread,
Sep 27, 2022, 12:52:49 AM9/27/22
to Valentyn Shybanov, chromium-hterm, Xiaohui Chen
You can access chrome-untrusted://terminal/html/nassh_preferences_editor.html to set custom CSS

Note that this page is not officially supported, which means that values you set in that page may get overwritten at any time by the supported settings page.

Valentyn Shybanov

unread,
Sep 27, 2022, 2:06:00 AM9/27/22
to chromium-hterm, Joel Hockey, chromium-hterm, Xiaohui Chen, Valentyn Shybanov
Unfortunately when I set font-name to FiraCode, the position of the cursor becomes skewed - always delayed by some characters :( 

Joel Hockey

unread,
Sep 27, 2022, 2:09:06 AM9/27/22
to Valentyn Shybanov, chromium-hterm, Xiaohui Chen
Rather than setting font-family in css for x-row, set it into the "Font family" item in settings.  It is needed in this item to calculate widths for cursor.

image.png
Reply all
Reply to author
Forward
0 new messages