🚀 Features
Multiple texture atlas page support (#4244, #4252, #4274) via @Tyriar
Instead of there being a hard cap of 1024x1024 on the size of the texture atlas backing the canvas and webgl renderers, multiple textures are now supported. Each individual texture is now 512x512 which allows faster uploading to the GPU and will continually merge until the maximum of 4096x4096 is reached.
The benefits in simple terms of this change are:
- Less time from drawing a glyph to rendering it
- Less CPU is used when lots of glyphs are used
- Essentially unlimited space for glyphs, which is good for certain use cases but will also let us explore things like "perfect" dotted and curvy underlines in the future
Here is an example of a 512x512 texture atlas page right after the terminal has loaded and printed a powerline-based prompt:
And here is the 1024x1024 page after a lot of glyphs have rendered:
Slash and triangle custom glyphs (#4313) via @Tyriar
Eight new powerline extra custom glyphs are supported:
New option scrollOnUserInput (#4289) via @JasonXJ
You can now specify whether to scroll to the bottom of the terminal on user input, previously this was the default and only behavior. This new setting is enabled by default.
const term = new Terminal({ scrollOnUserInput: false });
🐞 Bug fixes
- Fix width of upper 1/8 block character (#4134) via @Tyriar
- Allow the renderer to be set before
Terminal.open
is called (#4151) via @Tyriar - Fix trusted types in dom renderer (#4157) via @Tyriar
- Fix several memory retention issues (#4185) via @Tyriar
- Remove check proposed api checks (#4204) via @silamon
- Clear the extended attribute on
CSI 0 m
via @JasonXJ - Fix clipping of italic emoji (#4237) via @Tyriar
- Fix some edge cases in screenReaderMode (#4284) via @JasonXJ
- Send corresponding escape code for alt+space and ctrl+alt+space (#4290) via @JasonXJ
- Re-evaluate the link under the cursor instead dropping it completely when the terminal buffer changes (#4298) via @jerch
🏎️ Performance
- Optimizations to prevent blocking the main thread when resizing the buffer (#4115) via @jerch
- Reduce xterm.js start up time by deferring texture atlas warm up to an idle callback (#4131) via @Tyriar
- Optimize canvas contexts for frequent reading (#4137, #4169) via @Tyriar
- Share rgba vars throughout Color.ts, fast setTheme parseColor (#4140) via @Tyriar
- Introduce new IdleTaskQueue and PriorityTaskQueue internal helpers (#4141, #4143, #4144, #4155, #4293) via @Tyriar
- Defer paused renderer resize handling to idle callbacks (#4142) via @Tyriar
- Optimize critical I/O path for input latency (#4145, #4153, #4159, #4160, #4194) via @Tyriar, @jerch, @silamon
- Remove unnecessary clipping of texture atlas glyphs (#4200, #4201) via @Tyriar, @jerch
- Fix dropped frame issue caused by decorations (#4226) via @Tyriar
- Support multiple texture atlas pages (#4244) via @Tyriar
📝 Documentation and internal improvements
- Lint the codebase using putout (#4118) via @coderaiser
- Remove special publishing of v5 builds (#4123) via @Tyriar
- Correct comment on
allowProposedApi
(#4125) via @BattlefieldDuck - Move real-world uses section down (#4152) via @dstein64
- Remove queueMicrotask polyfill (#4154) via @Tyriar
- General refactoring (#4162, #4179, #4205, #4207, #4209, #4210, #4301, #4304, #4328) via @Tyriar
- Inline dirty row service into input handler (#4163) via @Tyriar
- Define all events and emitters consistently (#4165, #4177) via @Tyriar
- Bump copyright year (#4176) via @Tyriar
- Lint rule for on=event emitter and rename all methods with on prefix to handle (#4187) via @Tyriar
- Create theme service (#4188) via @Tyriar
- Switch CI agent to Ubuntu 20.04 (#4192) via @silamon
- Fix webgl loading in the demo (#4193) via @silamon
- Create onSpecificOptionChange and onMultipleOptionChange helpers (#4195) via @Tyriar
- Add eslint-plugin-jsdoc with minimal comment rules (#4206) via @Tyriar
- replit branding change (#4211) via @hackermondev
- Revert decoration dispose changes (#4215) via @meganrogge
- Change clearing innerText to using replaceChildren to fix testing using jsdom (#4217) via @Nokel81
- Fix resize in demo (#4233) via @Tyriar
- Cache ICoreBrowserService.isFocused per task (#4234) via @Tyriar
- Avoid GC pressure from server data buffer (#4235) via @Tyriar
- Add console.image helper (#4236) via @Tyriar
- Remove promise and fetch shims and use await for fetch (#4240) via @Tyriar
- Remove fill polyfill (#4249) via @Tyriar
- New test buttons in the demo (#4254, #4306, #4311, #4330) via @Tyriar
- Add custom keymap example to attachCustomKeyEventHandler docs (#4280) via @Tyriar
- Dev dependency updates (#4286, #4287) via @Tyriar, @dependabot
- Fix demo in Epiphany browser (#4291) via @jerch
- Explain danger of XSS more explicitly with the linkHandler API (#4310) via @Tyriar
- Point new issue questions at GH discussions (#4312) via @Tyriar
- Allow scroll bar interaction in demo in screenReaderMode (#4315) via @Tyriar
- Explain object option edge case (#4322) via @Tyriar
- Improve IAttributeData jsdoc (#4327) via @Tyriar
🛑 Breaking changes
- There is a new
allowNonHttpProtocols
property onILinkHandler
which forces the embedder to opt-in to non-http(s) protocols. This is a breaking change in a minor release as it could improve security of embedders.// before 5.1.0 const term = new Terminal({ linkHandler: { ... } }; // after 5.1.0 const term = new Terminal({ linkHandler: { // If you explicitly support and sanitize the links allowNonHttpProtocols: true, ... } };
🎉 New real-world use cases
- Super Terminal (#4276) via @bugwheels94
📥 Addons
xterm-addon-attach
xterm-addon-canvas
- Share texture atlases between the webgl and canvas renderers (#4170, #4168, #4182) via @Tyriar
- Fix glyphs becoming garbled or invisible (#4189) via @Tyriar
- Disable canvas ImageBitmap optimization on Safari (#4219) via @Tyriar
- Correctly offset minimumContrastRatio check (#4239) via @Tyriar
- Fix line height and letter spacing rendering (#4305) via @Tyriar
- Fix canvas renderer selection not re-rendering sometimes (#4325) via @Tyriar
xterm-addon-serialize
xterm-addon-webgl
- Fix glyphs becoming garbled or invisible (#4180, #4181) via @Tyriar
- Share texture atlases between the webgl and canvas renderers (#4170, #4168, #4182) via @Tyriar
- Enable the webgl renderer on safari 16 and above (#4255) via @Tyriar
- Fixes disappearance of characters in webgl renderer (#4271) via @jeanp413
- Fix NPE in webgl renderer (#4326) via @Tyriar
xterm-addon-web-links
- Major rework of the addon (#4288) via @jerch. This adds support for more URLs, fixes underlines sometimes being incorrect and changes the regex. There will be regressions in previous behavior with this but overall it's in a much better state. If you find any problems please report them to us.
- Add 1024 character limit (#4251) via @Tyriar
🤝 Compatible addon versions
xterm-addon-attach@0.7.0
xterm-addon-fit@0.7.0
xterm-addon-ligatures@0.6.0
xterm-addon-search@0.11.0
xterm-addon-serialize@0.9.0
xterm-addon-unicode11@0.5.0
xterm-addon-web-links@0.8.0
xterm-addon-webgl@0.14.0