You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tty-share/server/frontend/tty-share/main.ts

25 lines
552 B
TypeScript

import 'xterm/css/xterm.css';
import './main.css';
import { Terminal } from 'xterm';
import { TTYReceiver } from './tty-receiver';
const term = new Terminal({
cursorBlink: true,
macOptionIsMeta: true,
});
let wsAddress = "";
if (window.location.protocol === "https:") {
wsAddress = 'wss://';
} else {
wsAddress = "ws://";
}
let ttyWindow = window as any;
wsAddress += ttyWindow.location.host + ttyWindow.ttyInitialData.wsPath;
const ttyReceiver = new TTYReceiver(wsAddress, document.getElementById('terminal') as HTMLDivElement);