Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sixel support #970

Merged
merged 5 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion html/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ task('default', series('inline', () => {
.pipe(rename("html.h"))
.pipe(dest('../src/'));
}));

1 change: 1 addition & 0 deletions html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"whatwg-fetch": "^3.6.2",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-addon-image": "^0.1.0",
"xterm-addon-web-links": "^0.6.0",
"xterm-addon-webgl": "^0.12.0",
"zmodem.js": "^0.1.10"
Expand Down
6 changes: 5 additions & 1 deletion html/src/components/terminal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
9 changes: 9 additions & 0 deletions html/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ const baseConfig = {
'sass-loader',
],
},
{
test: /xterm-addon-image-worker/,
type: 'asset/inline',
generator: {
dataUrl: content => {
return content.toString();
}
}
},
]
},
resolve: {
Expand Down
5 changes: 5 additions & 0 deletions html/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7171,6 +7171,11 @@ xterm-addon-fit@^0.5.0:
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.5.0.tgz#2d51b983b786a97dcd6cde805e700c7f913bc596"
integrity sha512-DsS9fqhXHacEmsPxBJZvfj2la30Iz9xk+UKjhQgnYNkrUIN5CYLbw7WEfz117c7+S86S/tpHPfvNxJsF5/G8wQ==

xterm-addon-image@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.1.0.tgz#ead96aa224f5fcbfb45da2907f02368fe92985e6"
integrity sha512-xMvcEQ2rVUIXbbj5BRhznrZU24CRaMiSo8l2HH/E1FeE+G+KKduoF6mwja856/n4ekZ7K0ALZmmyDsbZODhDqQ==

xterm-addon-web-links@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.6.0.tgz#0296cb6c99588847894670d998c9ea6a6aeb26ee"
Expand Down