5.0.0
v5 is here! This is our largest release in a long time, maybe ever π
Since this was a major version bump, we used the opportunity to clean up the API and make other breaking changes. Many of these changes enabled a significant reduction in the xterm
module bundle size which went from 379kb to 265kb for a 30% reduction!
π Features
Underline style and color support (#3921, #3976, #3980, #4053, #4068, #4074, #4077, #4109) via @Tyriar
Underline style and color sequences such as CSI 4:2m ST
for double underlines are now supported:
Some work was also done to improve underline rendering overall, characters with long descenders don't overlap with the underline:
Hyperlink escape sequence support (#4005, #4087, #4088) via @Tyriar, @jerch
Building upon the improved underline rendering, hyperlink escapes outlined in this gist are now supported. They will be rendered using a dashed underline (like CSI 4:5m ST
):
Along with this is a new linkHandler
option which allows controling hover, leave and activate events, for example to show a custom tooltip. VS Code's implementation looks like this:
Smooth scroll support (#3940) via @Tyriar
The new smoothScrollDuration
allows setting a duration in milliseconds to animate scroll between the origin and target positions. This is most useful when using a physical mouse (not a trackpad) to help not disorient the user when scrolling with the mouse wheel.
Canvas renderer addon (#3949, #3950, #3954, #3959, #3961, #3981) via @Tyriar
The canvas renderer has moved into an addon, significantly reducing the bundle size of the xterm
module. This used to be the default renderer and is now recommended only as a fallback to the webgl addon if that does not work for some reason (eg. no webgl2 support).
New VT feature support (#4093, #4095, #4098)via @jerch
xterm.js handles several new VT sequences:
- SGR-pixels mouse reports support (#4093) via @jerch
- DECRQM support - ANSI and DEC private mode reporting (#4095) via @jerch
- Protection flag support (#4098) via @jerch
Other features
- Powerline semi-circle glyphs are now custom rendered (#3891) via @sbatten
- Inactive selection background (#3965) via @Tyriar -
ITheme.selectionInactiveBackground
will now change the selection color when the terminal is not focused - Support setting extended ansi colors 16-255 (#3905, #3909) via @silamon, @Tyriar
- The
parser
andbuffer
APIs are now stable (#3951) via @Tyriar - Rendering should now work when opening xterm.js in a popout window (#4069) via @mihaip
π Bug fixes
- Fix an exception when markers are deleted (#3888, #3901) via @Tyriar
- Make corner box glyphs uniformly round (#3895) via @Tyriar
- Fix changing
allowTransparency
from its initial value in theTerminal
constructor (#3899) via @Tyriar - Throw when setting an invalid
cursorStyle
(#3900) via @Tyriar - Allow markers in the alt buffer (#3924) via @silamon
- Retain hue when minimum contrast ratio flips luminance (#3929) via @Tyriar
- Remove shift+backspace -> ^H binding (#3935) via @Tyriar
- Fix disabling the webgl addon in the demo (#3988) via @Tyriar
- Improve deletion handling on Android (#4007) via @ink404
- Fix performance regression introduced with decoration support (#4080) via @Tyriar
π Documentation and internal improvements
- Update CI macOS base image (#3906) via @silamon
- Fix dev container docker build (#3907) via @silamon
- Add theme picker to demo (#3922) via @Tyriar
- Improve texture atlas presentation in demo (#3923, #3985) via @Tyriar
- Support overviewRulerWidth in demo (#3927) via @Tyriar
- Fix test-api running unit tests as well as API tests (#3934) via @Tyriar
- v5 release preparations (#3942, #3943, #3953, #3956, #3957, #3999) via @Tyriar
- Clarify in docs you shouldn't use the object after
Terminal.dispose
is called (#3958) via @Tyriar - Fix mocha test explorer support (#3966) via @silamon
- Add note to the
windowsMode
option for the version of Windows 11 that it's recommended to be disabled on (#3967) via @Tyriar - Fix demo when loading webgl addon throws (#3983) via @silamon
- Add ANSI colors test button to demo (#3991) via @deepanshu44
- The TypeScript output target is now es2015 (was es5) (#3992) via @SvanT, this resulted in a 17% reduction in bundle size
- Fix some typos (#4055) via @GreenMashimaro
- Fix lgtm.io recommendations (#4089) via @Tyriar
- Add CodeQL analysis to CI (#4090) via @Tyriar
π Breaking changes
-
bellSound
andbellStyle
options as well as the previously builtin sound have been removed (#3941) via @Tyriar. This reduces the bundle size while still allowing the embedder to support the terminal bell via theTerminal.onBell
API// before 5.0.0 term = new Terminal({ bellStyle: 'sound' }); // after 5.0.0 term = new Terminal(); term.onBell(() => { // Play a sound });
-
The link matcher API
registerLinkMatcher
andderegisterLinkMatcher
have been removed in favor of the link provider API (#3944) via @Tyriar. -
The
allowProposedApi
option now defaults tofalse
, set this totrue
to opt-in to proposed API usage if you understand the implications (#3945) via @Tyriar// before 5.0.0 term = new Terminal({}); term.someProposedApi(); // after 5.0.0 term = new Terminal({ allowProposedApi: true }); term.someProposedApi();
-
The deprecated
addMarker
API has been removed in favor ofregisterMarker
(#3946) via @Tyriar. They are functionally equivalent. -
The deprecated
getOption
andsetOption
APIs have been removed in favor ofoptions
(#3947) via @Tyriar// before 5.0.0 term.setOption('scrollback', 1000); console.log(term.getOption('scrollback')); // after 5.0.0 term.options.scrollback = 1000; console.log(term.options.scrollback);
-
The deprecated
writeUtf8
API has been removed in favor ofwrite
(#3947) via @Tyriar.const arr = new Uint8Array(10); // before 5.0.0 term.writeUtf8(arr); // after 5.0.0 term.write(arr);
-
ISelectionPosition
have been removed from the API in favor ofIBufferRange
(#3952) via @Tyriar -
cols
androws
options can now only be set in the constructor (#3960, #3972, #4078) via @Tyriar, @silamon// before 5.0.0 term.setOption('cols', 10); // after 5.0.0 term.resize(10, term.rows);
-
ITheme.selection
has been renamed toselectionBackground
for consistency (#3964) via @Tyriar// before 5.0.0 term.options.theme = { selection: '#000000' }; // after 5.0.0 term.options.theme = { selectionBackground: '#000000' };
-
The
Terminal.options
getter now returns aRequired<ITerminalOptions>
instead of justITerminalOptions
for better correctness. Along with this changefastScrollModifier
now accepts'none'
instead ofundefined
// before 5.0.0 new Terminal({ fastScrollModifier: undefined }); // after 5.0.0 new Terminal({ fastScrollModifier: 'none' });
π New real-world use cases
- Go SSH Web Client (#3883) via @wuchihsu
- web3os (#3884) via @mathiscode
- Cratecode (#3908) via @uellenberg
- Update maintained fork: yudai/gotty -> sorenisanerd/gotty (#4094) via @sorenisanerd
π₯ Addons
xterm-addon-canvas
- Redraw selection on resize (#3938) via @Tyriar
- Fix rendering of the
β
(U+259B) character (#3902) via @Tyriar - Fix blurry rendering that could happen when using a non-round devicePixelRatio (#3926, #4009, #4105) via @Tyriar, @jeanp413
- Overdraw powerline strokes such that the top and bottom are flat against the cell boundaries (#4070) via @Tyriar
- Show entire glyph for extra powerline symbols (#4073, #4086) via @Tyriar
xterm-addon-fit
xterm-addon-ligatures
- Warn when ligature fonts fail to download (#3933) via @Tyriar
- Fix the addon in the latest version of Chrome (#3936) via @Tyriar
- Fallback ligatures are now supported, allowing ligatures to work without font access (#3963) via @Tyriar
- Remove electron renderer and node targets (#4002, #4003) via @Tyriar
xterm-addon-web-links
- The link matcher-based implementation has been removed in favor of the link provider implementation (#3944) via @Tyriar
xterm-addon-webgl
More efficient GPU memory usage using new texture atlas packing strategy (#3979) via @Tyriar
The previous naive texture packing strategy which only allowed adding to the "active row" or below has been replaced with a new strategy that uses multiple active rows and adds glyphs to the most suitable row based on its pixel height. This leads to more effective usage of the texture xterm.js uploads to the GPU, meaning it's harder to reset the texture when it becomes filled (which is more likely to happen when screen scale is high).
Before:
After:
Other changes
- Release webgl resources when the addon is disposed (#3890) via @Tyriar
- Clip pixels to the left of a cell when the background color changes, preventing pixels overflowing (#3896) via @Tyriar
- Clear glyph pixels when all channels differ below some threshold (#3897) via @Tyriar
- Fix rendering of the
β
(U+259B) character (#3902) via @Tyriar - Fix blurry rendering that could happen when using a non-round devicePixelRatio (#3926, #4009, #4105) via @Tyriar, @jeanp413
- Fix dim rendering edge cases (#3973, #3989) via @Tyriar
- Fix powerline and other custom glyph offsets and support letter spacing (#3985, #4085) via @Tyriar
- Polish powerline rendering so the middle of the stroke won't be cut off (#3987) via @Tyriar
- Overdraw powerline strokes such that the top and bottom are flat against the cell boundaries (#4070) via @Tyriar
- Show entire glyph for extra powerline symbols (#4073, #4086) via @Tyriar
- Improve handling of canvas context loss (#4075) via @kenrussell
- Fix performance regressions (#4081, #4084) via @Tyriar
- Clear the glyph renderer when the model is cleared (#4101) via @JasonXJ
- Fix the cursor character being drawn outside the cursor cell (#4102) via @JasonXJ
π€ Compatible addon versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
π Website
- Fix bootstrap 404 in some locales (xtermjs/xtermjs.org#179) via @fu1996