Bot releases are hidden (Show)
Published by Tyriar over 4 years ago
[email protected]
[email protected]
[email protected]
(this addon may have issues)[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Published by Tyriar over 4 years ago
Terminal
more than once (#2934) via @TyriarTerminal
if a framework like React has already unmounted the element (#2962) via @JoshuaKGoldberggetSelection
sometimes not working for single character selections (#2973) via @daniel-j-davis[email protected]
[email protected]
[email protected]
(this addon may have issues)[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
onData
instead of onKey
in demo (xtermjs/xtermjs.org#128) via @TyriarPublished by Tyriar over 4 years ago
\e\r
(#2718) via @kumaran-14linkTooltipHoverDuration
setting, this is a workaround for the old deprecated link matcher system (#2835) via @TyriarenableProposedApi
setting that currently defaults to true, in v5 this will switch to false to require the embedder to opt-in to using the experimental APIs that may break across versions (#2921) via @Tyriar[email protected]
[email protected]
[email protected]
(this addon may have issues)[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Published by Tyriar over 4 years ago
registerLinkMatcher
API. You can test this new API by setting the _useLinkProvider
parameter on the web links addon.// before 4.5.0
const activeBuffer = term.buffer
// after 4.5.0
const activeBuffer = term.buffer.active
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Published by Tyriar over 4 years ago
Terminal.write(serializedState)
. See the xterm-addon-serialize
section below for more info.xterm-addon-unicode11
section below for more info.windowOptions
option as they have security implications.new Terminal({
cursorStyle: 'bar',
cursorBarWidth: 3
});
#rrggbbaa
color format (#2629) via @ivanwonder;
and :
from the default wordSeparator
option so more URLs are selected fully with double click (#2680) via @TyriarcursorBlink
or cursorStyle
(#2684) via @Tyriaradd
in the experimental parser API have been removed in favor of register
as it enters stable status (#2651) via @TyriaraddMarker
is now deprecated, move over to registerMarker
which is functionally equivalent (#2651) via @TyriarThis new addon has allows serializing terminal state (text, color and style currently) and writing it to new Terminal
objects to restore it (#2369, #2618, #2687) via @JavaCS3
const t = new Terminal();
const serializeAddon = new SerializeAddon();
t.loadAddon(serializeAddon);
await new Promise(r => t.write('foo \x1b[31mbar', r));
const state = serializeAddon.serialize();
console.log(state); // 'foo \x1b[31mbar'
This new addon can be enabled to resolve unicode character widths based on version 11 of unicode (#2568) via @jerch.
const t = new Terminal();
// 🤣 is now single width (unicode 6)
const unicode11Addon = new Unicode11Addon();
t.loadAddon(unicode11Addon);
t.unicode.activeVersion = '11';
// 🤣 is now treated as double width
Published by Tyriar almost 5 years ago
The WebGL renderer addon got quite a bit of work done on it this release and is quickly approaching parity with the other renderers. It has also been integrated into VS Code as an experimental option.
From our benchmarks the WebGL renderer renders frames up to 900% faster than the canvas renderer and even more in extreme cases where there are hardware issues with the canvas renderer.
Here's a comparison of example frames rendered using the canvas and webgl renderers (Windows 10, Intel Xeon E5-1620 @ 3.5GHz, AMD FirePro W2100):
Faster rendering also means more frames overall and faster commands. The below is a run of ls -lR
on the same machine inside the VS Code codebase:
Read more about why it's so good in https://github.com/microsoft/vscode/pull/84440 🔥
The new option minimumContrastRatio
has been added that dynamically changes the foreground color to improve contrast (#2563, #2602) via @Tyriar
onBinary
event enabled support for some mouse report events that cannot be expressed in JS strings (UTF8) (#2566) via @jerchyarn
in repo root (#2516) via @jerchbeta.X
format instead of betaX
to better follow semver (#2577, #2579) via @Tyriar<h4>
more prominent (https://github.com/xtermjs/xtermjs.org/pull/107) via @TyriarPublished by Tyriar almost 5 years ago
SL
- Scroll leftSR
- Scroll rightDECIC
- Insert columnsDECDC
- Delete columns// Scroll 2 times faster than normal
const term = new Terminal({
scrollSensitivity: 2
});
// Scroll 10 times faster than normal when holding alt
const term = new Terminal({
fastScrollSensitivity: 10,
fastScrollModifier: 'alt'
});
interface ILinkMatcherOptions {
tooltipCallback?: (event: MouseEvent, uri: string, location: IViewportRange) => boolean | void;
}
Infinity
and NaN
are provided to an API that expects an integer (#2451) via @Tyriarelement
and textarea
correctly with | undefined
in the API (#2473) via @Tyriar,
, ;
and :
as default characters included in the wordSeparator
option (#2474) via @glnetoIMarker.line
to -1
when disposed (#2510) via @TyriarscrollSensitivity
when fast scrolling (#2514) via @Tyriaropen
on an element not attached to the DOM (#2450, #2497) via @Tyriar.only
in CI (#2493) via @leomotyIViewportRange
API (#2512) via @TyriarproposeDimensions
from returning values less than the minimum dimensions (#2483) via @leomotyPublished by Tyriar about 5 years ago
A callback can now be specified when calling Terminal.write
that fires when the terminal has parsed the provided data (#2422) via @jerch. This is useful to know when the terminal state has definitely been updated after a write since writes are deferred and done in chunks to avoid locking up the web page.
const term = new Terminal();
term.write('hello world', () => console.log('processed'));
We decided to use a callback-based approach here rather than promise-based since write
is one of the most performance critical parts of xterm.js and it can easily be adapted into a promise:
const p = new Promise(r => term.write('hello world', r));
Terminal.write
and Terminal.writeln
now accept an Uint8Array
in addition to string
(#2422) via @jerch
Terminal.writeUtf8
has been deprecated in favor of Terminal.write
(#2422) via @jerch
// deprecated
term.writeUtf8(buffer);
// recommended
term.write(buffer);
Terminal.write
instead of Terminal.writeUtf8
(#2422) via @jerchPublished by Tyriar about 5 years ago
Terminal.open
twice (#2433) via @Tyriar, @leojhPublished by Tyriar about 5 years ago
Terminal
constructor export to correctly be at window.Terminal
when including just the script (#2415) via @Tyriar"xterm": "^4.0.0"
(#2429) via @Tyriar, @milleniumfrogPublished by Tyriar about 5 years ago
Finally v4 has arrived! This is our biggest release to date with 128 PRs being merged (v3 had 101). The major focuses for this version were:
The plan is for each new minor release to now state which addons are compatible with the library at the bottom, this might not be needed in the future but we'll evaluate that later on. We've also added a dedicated Addons section instead of mixing their updates in with the core library.
The new addon system that was introduced in 3.14.0 is now stable (#2377) via @Tyriar. This new system allows encapsulating additional functionality that leverages the xterm.js API into a module that can be shared between users of xterm.js. The API itself is extremely simple but improves over its previous incarnation with first-class TypeScript support and per-terminal lifecycle management.
export class Terminal implements IDisposable {
/**
* Loads an addon into this instance of xterm.js.
* @param addon The addon to load.
*/
loadAddon(addon: ITerminalAddon): void;
}
/**
* An addon that can provide additional functionality to the terminal.
*/
export interface ITerminalAddon extends IDisposable {
/**
* This is called when the addon is activated.
*/
activate(terminal: Terminal): void;
}
Creating an addon is as simple as providing an object with the activate
and dispose
methods available:
class ExampleAddon {
private _terminal: Terminal | undefined;
activate(terminal: Terminal): void {
this._terminal = terminal;
console.log('activated');
}
dispose(): void {
console.log('disposed');
}
}
And used like this:
const terminal = new Terminal();
terminal.loadAddon(new ExampleAddon());
// Logs 'activated'
terminal.dispose();
// Logs 'disposed'
Addons shipped by the xterm.js team are listed at the bottom of release notes and can be installed via npm.
wordSeparator
option that defines what a word boundary is when double click selecting (#2244, #2262) via @MaxRis
// Include ' and " in words
const term = new Terminal({ wordSeparator: ' ()[]{}' });
addEscHandler
, addDcsHandler
parser hook APIs and existing addCsiHandler
and addOscHandler
APIs have been refined (#2346) via @jerch
// Do something whenever the cursor move (CUP) sequence is triggered
term.parser.addCsiHandler({ final: 'H' }, params => doSomething(params));
See the API documentation for more information.term.paste(await navigator.clipboard.readText());
cls
under ConPTY to not redraw rows sometimes (#2149) via @TyriarIBufferCell.getCell
to correctly indicate it can return undefined
(#2184) via @Tyriarstyle
field to package.json so certain tools can locate the xterm.css file (#2221) via @blink1073z-index
's of xterm components to avoid conflicts with embedder UIs (#2276) via @TyriarwindowsMode
(#2278) via @MaxRisdispose
do nothing when called a second time (#2353) via @Tyriarxterm-256color
in demo (#2198) via @jerchdeclarationMap
compiler option (#2269) via @Tyriar_
prefix for protected members (#2273) via @TyriarlogLevel
is debug
(#2328, #2338) via @Tyriarnode_modules/xterm/lib/xterm.css
has been moved to node_modules/xterm/css/xterm.css
(#2132) via @Tyriarnode_modules/xterm/dist/xterm.js
no longer exists and node_modules/xterm/lib/xterm.js
is now minified (#2132) via @Tyriar// before 4.0.0
term.on('data', data => console.log(data));
// after 4.0.0
term.onData(data => console.log(data));
// before 4.0.0
term.destroy();
// after 4.0.0
term.dispose();
enableBold
option (#2156) via @Tyriar
// before 4.0.0
term.setOption('enableBold', false);
// after 4.0.0
term.setOption('fontWeightBold', 'normal');
// before 4.0.0
const term = new Terminal({ experimentalCharAtlas: 'static' });
// after 4.0.0
// No-op, the previous 'dynamic' is the only option available now due to
// superior performance in every way.
blankLine
localized string, this improves how screen readers announce blank lines (#2284) via @Tyriar
// before 4.0.0
Terminal.strings.blankLine = '<localized string>';
// after 4.0.0
// No-op
applyAddon
-based addon system has been removed (#2377) via @Tyriar. New addons are installed as separate packages via npm and enabled via the non-static Terminal.loadAddon
, this improved the overall lifecycle of addons as well as fix issues with typings when working with TypeScript.
// before 4.0.0
import { Terminal } from 'xterm';
import * as fit from 'xterm/lib/addons/fit/fit';
Terminal.applyAddon(fit);
const terminal = new Terminal();
terminal.fit();
// after 4.0.0
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
const terminal = new Terminal();
const fitAddon = new FitAddon();
terminal.loadAddon(fitAddon);
fitAddon.fit();
findPrevious
and the top of the buffer for findNext
(#2340) via @lramos15feat/serialize-addon
branch (#2298) via @JavaCS3After a long time in PR the WebGL renderer has finally been moved to an addon that can be tried out using xterm.js v4 (#1790, #2235, #2285) via @Tyriar
The addon boasts significant performance improvements over the current canvas and DOM renderers but lacks some features and is still a little rough around the edges. Here are some numbers that were measured when the feature was in development (see #1790 for methodology):
Benchmark | Canvas/dynamic (avg ms/frame) | WebGL (avg ms/frame) | Change (c/w-1) |
---|---|---|---|
Macbook 87x26 | 4.80 | 0.69 | 596% faster |
Macbook 300x80 | 15.28 | 3.69 | 314% faster |
Windows 87x26 | 7.31 | 0.73 | 901% faster |
Windows 300x80 | 19.34 | 2.06 | 839% faster |
Macbook 87x26 CJK | 14.63 | 5.93 | 147% faster |
Macbook 87x26 Emoji | 27.47 | 19.28 | 42% faster |
See this query for a list of known issues with the WebGL renderer.
Published by Tyriar over 5 years ago
windowsMode
(#2278) via @MaxRisTerminal.open
(#2222) via @TyriarPublished by Tyriar over 5 years ago
Published by Tyriar over 5 years ago
Terminal.open
multiple times (#2179) via @TyriarPublished by Tyriar over 5 years ago
Published by Tyriar over 5 years ago
📢 Our next release will be v4, read more here 👉 #2143.
Compatible new addon versions:
For the complete details on the new APIs, see the typings file. For APIs marked experimental we're hoping to stabilize them in v4 and want feedback from the community to make sure they are useful.
const data = new Uint8Array([102, 111, 111]);
term.writeUtf8(data);
// A simple example addon
const addon = {
activate: (term: Terminal) => {
console.log('addon activated');
},
dispose: () => { }
}
term.loadAddon(addon);
// Print the line that the cursor is on as text
term.buffer.getLine(term.buffer.cursorY).translateToString(true);
select
and getSelectionPosition
APIs (#2078) via @Tyriar
term.select(5, 2, 10);
console.log(term.getSelectionPosition());
// {startColumn: 5, startRow: 2, endColumn: 15, endRow: 2}
windowsMode
option (#2062) via @Tyriar+
in links weblink path (#2046) via @NizamLZwriteUtf8
in the demo (#2080) via @jerchPublished by Tyriar over 5 years ago
Published by Tyriar over 5 years ago
screenReaderMode
is enabled (#2085) via @TyriarPublished by Tyriar over 5 years ago
drawBoldTextInBrightColors
option (https://github.com/xtermjs/xterm.js/pull/1961) via @nikonsocursorBlink
option (https://github.com/xtermjs/xterm.js/pull/1979, https://github.com/xtermjs/xterm.js/pull/2039) via @JesseStolwijk, @roottoolwindowsMode
option replaces the old winptyCompat addon (https://github.com/xtermjs/xterm.js/pull/1978, https://github.com/xtermjs/xterm.js/pull/1985, https://github.com/xtermjs/xterm.js/pull/1993) via @Tyriar, note that there are no longer the previous protections in place to prevent the mode from running on non-Windows operating systems.Terminal.markers
is now a ReadonlyArray
(previously []
) (https://github.com/xtermjs/xterm.js/pull/2036) via @Tyriar^_
sequence (emacs undo) (https://github.com/xtermjs/xterm.js/pull/2052) via @jflatowwinptyCompat
addon has been moved into core and is now enabled via the windowsMode
option:
// before 3.13.0
import winptyCompat = require('vscode-xterm/lib/addons/winptyCompat/winptyCompat');
Terminal.applyAddon(winptyCompat);
const term = new Terminal();
// after 3.13.0
const term = new Terminal({ windowsMode: true });
See the API section for more information.on
, off
, emit
and addDisposableListener
APIs are now deprecated and are planned to be removed in v4.0.0 (https://github.com/xtermjs/xterm.js/pull/2008) via @Tyriar, they are replaced with the new "explicit event API".
// deprecated
term.on('resize', e => doSomething(e));
// recommended
term.onResize(e => doSomething(e));
We took this opportunity to slim down the events, cutting out some that we thought are no longer needed. If you are using any events that were not carried over to the new event API please create an issue and let us know how you're using it to see if we should expose it.A special thanks to @Eugeny of the Terminus project for trialing the beta release and helping catch some nasty bugs before we released ❤️
Published by Tyriar over 5 years ago
dist/
directory (#2013) via @Tyriar