Skip to content

Releases: BattlefieldDuck/xterm-svelte

2.2.1

18 Jan 18:58

Choose a tag to compare

What's Changed

  • Bump the npm-minor-and-patch group across 1 directory with 2 updates by @dependabot[bot] in #236
  • Bump globals from 16.5.0 to 17.0.0 in the npm-majors group by @dependabot[bot] in #238
  • Bump svelte from 5.46.1 to 5.46.4 by @dependabot[bot] in #241
  • Bump devalue from 5.6.1 to 5.6.2 by @dependabot[bot] in #240
  • Bump @sveltejs/kit from 2.49.2 to 2.49.5 by @dependabot[bot] in #239
  • Bump the npm-minor-and-patch group across 1 directory with 8 updates by @dependabot[bot] in #243

Full Changelog: 2.2.0...2.2.1

2.2.0

23 Dec 23:21

Choose a tag to compare

Update xterm.js addons and types for v6 compatibility.

What's Changed

  • Bump the npm-minor-and-patch group across 1 directory with 14 updates by @dependabot[bot] in #224
  • Bump js-yaml from 4.1.0 to 4.1.1 by @dependabot[bot] in #225
  • Bump actions/setup-node from 5 to 6 in the actions-majors group by @dependabot[bot] in #222
  • Bump actions/checkout from 5 to 6 in the actions-majors group by @dependabot[bot] in #229
  • Bump the npm-majors group with 2 updates by @dependabot[bot] in #228
  • Bump the npm-minor-and-patch group across 1 directory with 13 updates by @dependabot[bot] in #232
  • Bump @types/node from 24.10.0 to 25.0.3 in the npm-majors group by @dependabot[bot] in #234
  • Bump the npm-minor-and-patch group with 2 updates by @dependabot[bot] in #233

Full Changelog: 2.1.1...2.2.0

2.1.1

28 Sep 14:19

Choose a tag to compare

Updated xterm-svelte example

$state + Type-Safe options + Null-Safe Calls

<script lang="ts">
	import { Xterm, XtermAddon } from '@battlefieldduck/xterm-svelte';
	import type {
		ITerminalOptions,
		ITerminalInitOnlyOptions,
		Terminal
	} from '@battlefieldduck/xterm-svelte';

+	let terminal = $state<Terminal>();
-	let terminal: Terminal;

+	const options: ITerminalOptions & ITerminalInitOnlyOptions = {
-	let options: ITerminalOptions & ITerminalInitOnlyOptions = {
		fontFamily: 'Consolas'
	};

	async function onLoad() {
		console.log('Child component has loaded');

		// FitAddon Usage
		const fitAddon = new (await XtermAddon.FitAddon()).FitAddon();
+		terminal?.loadAddon(fitAddon);
- 		terminal.loadAddon(fitAddon);
		fitAddon.fit();

+		terminal?.write('Hello World');
-		terminal.write('Hello World');
	}

	function onData(data: string) {
		console.log('onData()', data);
	}

	function onKey(data: { key: string; domEvent: KeyboardEvent }) {
		console.log('onKey()', data);
	}
</script>

<Xterm bind:terminal {options} {onLoad} {onData} {onKey} />

What's Changed

Full Changelog: 2.1.0...2.1.1

2.1.0

17 Nov 19:30
a7d2420

Choose a tag to compare

Support Terminal Bindable

To bind the terminal in Svelte, you can use the following code:

<script lang="ts">
  // ... imports

  let terminal: Terminal;
</script>

<Xterm bind:terminal />

This allows you to bind the terminal variable to the Xterm component when the terminal is initialized.

What's Changed

Full Changelog: 2.0.1...2.1.0

2.0.1

10 Nov 15:49

Choose a tag to compare

  • Fix peerDependencies error while installation

What's Changed

Full Changelog: 2.0.0...2.0.1

2.0.0

04 Nov 08:06
e03b811

Choose a tag to compare

Svelte 5 migration guide

Deprecating createEventDispatcher and the on: directive in favour of callback props and normal element properties

Component events

In Svelte 4, components could emit events by creating a dispatcher with createEventDispatcher.

This function is deprecated in Svelte 5. Instead, components should accept callback props - which means you then pass functions as properties to these components:

- <Xterm {options} on:load={onLoad} on:data={onData} on:key={onKey} />
+ <Xterm {options} {onLoad} {onData} {onKey} />
- async function onLoad(event: CustomEvent<{ terminal: Terminal }>) {
+ async function onLoad(terminal: Terminal) {
    console.log('Child component has loaded');
-   const terminal = event.detail.terminal;
    
    // FitAddon Usage
    const fitAddon = new (await XtermAddon.FitAddon()).FitAddon();
    terminal.loadAddon(fitAddon);
    fitAddon.fit();
    
    terminal.write('Hello World');
}
- function onData(event: CustomEvent<string>) {
+ function onData(data: string) {
-   const data = event.detail;
    console.log('onData()', data);
}
- function onKey(event: CustomEvent<{ key: string; domEvent: KeyboardEvent }>) {
+ function onKey(data: { key: string; domEvent: KeyboardEvent }) {
-   const data = event.detail;
    console.log('onKey()', data);
}

What's Changed

New Contributors

Full Changelog: 1.0.1...2.0.0

1.0.1

04 Nov 03:21

Choose a tag to compare

What's Changed

Full Changelog: 1.0.0...1.0.1

1.0.0

08 May 11:24
4e74aaa

Choose a tag to compare

What's Changed

Full Changelog: 0.1.0...1.0.0

0.1.0

30 Apr 06:04

Choose a tag to compare

Full Changelog: 0.0.5...0.1.0

0.0.5

28 Apr 02:49

Choose a tag to compare

Full Changelog: 0.0.4...0.0.5