added stuff
This commit is contained in:
parent
7742aa620d
commit
9e5cea5b8c
@ -27,15 +27,14 @@ function TerminalComponent (p: {websocket: string|null}) {
|
||||
const socket = new WebSocket(websocket);
|
||||
|
||||
socket.addEventListener('open', () => {
|
||||
terminal.current?.write('Connected to the WebSocket server\r\n');
|
||||
});
|
||||
|
||||
socket.addEventListener('message', (event) => {
|
||||
terminal.current?.write(event.data);
|
||||
terminal.current?.write(event.data.replace(/\r\n/g, '\n'));
|
||||
});
|
||||
|
||||
terminal.current.onData((data) => {
|
||||
socket.send(data);
|
||||
socket.send(JSON.stringify({CommandType: 'insert', Arguments: [data]}));
|
||||
});
|
||||
|
||||
return () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user