Today we are announcing xterm.js 2.3! Below you can find some of the most important updates of this release.
The speed of xterm.js has been improved significantly this release due to optimizations in buffer management, the parser and the renderer. You should expect to see a responable framerate even when the commands generate a lot of output. Commands also typically run around 5 times faster.
Previously when the terminal’s buffer was filled it would be chopped in half to make room for more data, this is why there was some quirky behavior with the scroll bar when a lot of output was processed. Now the buffer is managed in a circular list which makes it faster from both a memory and CPU perspective.
A bonus that came from this is that scroll events are no longer fired on every new line when the buffer is full since no scroll actually happens anymore since the viewport stays in the same position.
The renderer saw huge improvements. All DOM interactions are now performed asynchronously in animation frames, meaning the DOM will only be updated at most 60 times per second (most browsers). Additional frame skipping is also used to skip frames when the renderer knows more writes are pending in the write queue, this saves CPU cycles that could be better used by the parser. Other improvements:
- Minimizing forced layouts by limiting usage of things like
- Added experimental flow control support via the
useFlowControloption which will allow xterm.js to tell the pty to pause (XOFF signal) and resume (XON signal). When this is enabled ctrl+c (
SIGINT) should be more responsive and commands like
timeshould be more accurate as xterm.js and the backing pty are synced. Note that this is disabled by default and shell support appears to be limited outside of
Parsing is now performed in chunks and asynchronously instead of all at once synchronously, this means no more parser-based lock ups. The parser itself was also optimized by converting the majority of the switch statements (O(n)) to be instead driven by maps (O(1)).
Cursor style support
The underline and bar cursor type are now supported, these can also be set using the CSI sequence to set the cursor style.
VT100 character sets
All VT100 national replacement character sets (NRC sets) are now supported: British, Dutch, Finnish, French, French Canadian, German, Italian, Norwegian/Danish, Spanish, Swedish and Swiss.
^S (XOFF) and
^Q (XON) are now correctly handled by xterm.js, allowing them to trigger pause and resume.
Big strides were made in the TypeScript conversion this release with approximately 2/3 of the xterm.js now living as TypeScript files.
Here are the other features added this release:
- alt+left/right now skips words on Mac.
disableStdinoption that will completely disable all input handling.
tabStopWidthoption to customize the size of tabs.
Check out the GitHub release for bug fixes and a complete list of changes in this release.
A big thank you to our contributors!
As always, this release would not have been possible without the contribution of our amazing contributors.
We would like to thank and credit all of external contributors for their work on xterm.js:
- LucianBuzzo for fixing an issue with setting a scroll region out of bounds of the terminal
- vincentwoo for enabling builds installed via npm
- blink1073 for ensuring latest build files are included in releases
- BobReid for making alt+arrow skip words on macOS
- saswatds for adding a getting started section to the README
- arcanis for making the fit addon aware of the scroll bar
- budde377 for improving how we bundle xterm.js