Skip to content

Releases: BattlefieldDuck/xterm-svelte

2.1.0

17 Nov 19:30
a7d2420
Compare
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
Compare
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
Compare
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
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.0...1.0.1

1.0.0

08 May 11:24
4e74aaa
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.1.0...1.0.0

0.1.0

30 Apr 06:04
Compare
Choose a tag to compare

Full Changelog: 0.0.5...0.1.0

0.0.5

28 Apr 02:49
Compare
Choose a tag to compare

Full Changelog: 0.0.4...0.0.5

0.0.4

28 Apr 01:47
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.0.3...0.0.4

0.0.3

26 Apr 14:13
Compare
Choose a tag to compare

Full Changelog: 0.0.2...0.0.3

0.0.2

26 Apr 07:16
Compare
Choose a tag to compare

Full Changelog: 0.0.1...0.0.2