mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-19 02:24:20 +01:00
html: add xterm clipboard addon
This commit is contained in:
@@ -53,6 +53,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@xterm/addon-canvas": "^0.7.0",
|
"@xterm/addon-canvas": "^0.7.0",
|
||||||
|
"@xterm/addon-clipboard": "^0.1.0",
|
||||||
"@xterm/addon-fit": "^0.10.0",
|
"@xterm/addon-fit": "^0.10.0",
|
||||||
"@xterm/addon-image": "^0.8.0",
|
"@xterm/addon-image": "^0.8.0",
|
||||||
"@xterm/addon-unicode11": "^0.8.0",
|
"@xterm/addon-unicode11": "^0.8.0",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { bind } from 'decko';
|
|||||||
import type { IDisposable, ITerminalOptions } from '@xterm/xterm';
|
import type { IDisposable, ITerminalOptions } from '@xterm/xterm';
|
||||||
import { Terminal } from '@xterm/xterm';
|
import { Terminal } from '@xterm/xterm';
|
||||||
import { CanvasAddon } from '@xterm/addon-canvas';
|
import { CanvasAddon } from '@xterm/addon-canvas';
|
||||||
|
import { ClipboardAddon } from '@xterm/addon-clipboard';
|
||||||
import { WebglAddon } from '@xterm/addon-webgl';
|
import { WebglAddon } from '@xterm/addon-webgl';
|
||||||
import { FitAddon } from '@xterm/addon-fit';
|
import { FitAddon } from '@xterm/addon-fit';
|
||||||
import { WebLinksAddon } from '@xterm/addon-web-links';
|
import { WebLinksAddon } from '@xterm/addon-web-links';
|
||||||
@@ -84,6 +85,8 @@ export class Xterm {
|
|||||||
private terminal: Terminal;
|
private terminal: Terminal;
|
||||||
private fitAddon = new FitAddon();
|
private fitAddon = new FitAddon();
|
||||||
private overlayAddon = new OverlayAddon();
|
private overlayAddon = new OverlayAddon();
|
||||||
|
private clipboardAddon = new ClipboardAddon();
|
||||||
|
private webLinksAddon = new WebLinksAddon();
|
||||||
private webglAddon?: WebglAddon;
|
private webglAddon?: WebglAddon;
|
||||||
private canvasAddon?: CanvasAddon;
|
private canvasAddon?: CanvasAddon;
|
||||||
private zmodemAddon?: ZmodemAddon;
|
private zmodemAddon?: ZmodemAddon;
|
||||||
@@ -149,7 +152,7 @@ export class Xterm {
|
|||||||
@bind
|
@bind
|
||||||
public open(parent: HTMLElement) {
|
public open(parent: HTMLElement) {
|
||||||
this.terminal = new Terminal(this.options.termOptions);
|
this.terminal = new Terminal(this.options.termOptions);
|
||||||
const { terminal, fitAddon, overlayAddon } = this;
|
const { terminal, fitAddon, overlayAddon, clipboardAddon, webLinksAddon } = this;
|
||||||
window.term = terminal as TtydTerminal;
|
window.term = terminal as TtydTerminal;
|
||||||
window.term.fit = () => {
|
window.term.fit = () => {
|
||||||
this.fitAddon.fit();
|
this.fitAddon.fit();
|
||||||
@@ -157,7 +160,8 @@ export class Xterm {
|
|||||||
|
|
||||||
terminal.loadAddon(fitAddon);
|
terminal.loadAddon(fitAddon);
|
||||||
terminal.loadAddon(overlayAddon);
|
terminal.loadAddon(overlayAddon);
|
||||||
terminal.loadAddon(new WebLinksAddon());
|
terminal.loadAddon(clipboardAddon);
|
||||||
|
terminal.loadAddon(webLinksAddon);
|
||||||
|
|
||||||
terminal.open(parent);
|
terminal.open(parent);
|
||||||
fitAddon.fit();
|
fitAddon.fit();
|
||||||
|
|||||||
@@ -1267,6 +1267,17 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@xterm/addon-clipboard@npm:^0.1.0":
|
||||||
|
version: 0.1.0
|
||||||
|
resolution: "@xterm/addon-clipboard@npm:0.1.0"
|
||||||
|
dependencies:
|
||||||
|
js-base64: ^3.7.5
|
||||||
|
peerDependencies:
|
||||||
|
"@xterm/xterm": ^5.4.0
|
||||||
|
checksum: fe33d28223ae7f9965653c6c946a68e06f1d884fba1d11e8bcb52dcc608dbb2240caf48573d6297daefa56696e88f963148a1035ccf034cb6fb4f88f506a2ec7
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@xterm/addon-fit@npm:^0.10.0":
|
"@xterm/addon-fit@npm:^0.10.0":
|
||||||
version: 0.10.0
|
version: 0.10.0
|
||||||
resolution: "@xterm/addon-fit@npm:0.10.0"
|
resolution: "@xterm/addon-fit@npm:0.10.0"
|
||||||
@@ -6431,6 +6442,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"js-base64@npm:^3.7.5":
|
||||||
|
version: 3.7.7
|
||||||
|
resolution: "js-base64@npm:3.7.7"
|
||||||
|
checksum: d1b02971db9dc0fd35baecfaf6ba499731fb44fe3373e7e1d6681fbd3ba665f29e8d9d17910254ef8104e2cb8b44117fe4202d3dc54c7cafe9ba300fe5433358
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"js-tokens@npm:^4.0.0":
|
"js-tokens@npm:^4.0.0":
|
||||||
version: 4.0.0
|
version: 4.0.0
|
||||||
resolution: "js-tokens@npm:4.0.0"
|
resolution: "js-tokens@npm:4.0.0"
|
||||||
@@ -10475,6 +10493,7 @@ __metadata:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/eslint-plugin": ^7.1.1
|
"@typescript-eslint/eslint-plugin": ^7.1.1
|
||||||
"@xterm/addon-canvas": ^0.7.0
|
"@xterm/addon-canvas": ^0.7.0
|
||||||
|
"@xterm/addon-clipboard": ^0.1.0
|
||||||
"@xterm/addon-fit": ^0.10.0
|
"@xterm/addon-fit": ^0.10.0
|
||||||
"@xterm/addon-image": ^0.8.0
|
"@xterm/addon-image": ^0.8.0
|
||||||
"@xterm/addon-unicode11": ^0.8.0
|
"@xterm/addon-unicode11": ^0.8.0
|
||||||
|
|||||||
28050
src/html.h
generated
28050
src/html.h
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user