mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-01-04 09:54:24 +01:00
html: add sixel support (#970)
* sixel support * make linter happy * picky linters gonna be picky * simplify worker inlining * rebuild html Co-authored-by: Shuanglei Tao <tsl0922@gmail.com>
This commit is contained in:
@@ -4,11 +4,14 @@ import { ITerminalOptions, RendererType, Terminal } from 'xterm';
|
||||
import { FitAddon } from 'xterm-addon-fit';
|
||||
import { WebglAddon } from 'xterm-addon-webgl';
|
||||
import { WebLinksAddon } from 'xterm-addon-web-links';
|
||||
|
||||
import { ImageAddon } from 'xterm-addon-image';
|
||||
import { OverlayAddon } from './overlay';
|
||||
import { ZmodemAddon, FlowControl } from '../zmodem';
|
||||
|
||||
import 'xterm/css/xterm.css';
|
||||
import worker from 'xterm-addon-image/lib/xterm-addon-image-worker';
|
||||
|
||||
const imageWorkerUrl = window.URL.createObjectURL(new Blob([worker], { type: 'text/javascript' }));
|
||||
|
||||
interface TtydTerminal extends Terminal {
|
||||
fit(): void;
|
||||
@@ -176,6 +179,7 @@ export class Xterm extends Component<Props> {
|
||||
terminal.loadAddon(overlayAddon);
|
||||
terminal.loadAddon(new WebLinksAddon());
|
||||
terminal.loadAddon(this.zmodemAddon);
|
||||
terminal.loadAddon(new ImageAddon(imageWorkerUrl));
|
||||
|
||||
terminal.onTitleChange(data => {
|
||||
if (data && data !== '' && !this.titleFixed) {
|
||||
|
||||
Reference in New Issue
Block a user