Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Adaptate terminal to the upstream #652

Merged
merged 4 commits into from
Mar 4, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion extensions/eclipse-che-theia-terminal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"dependencies": {
"@theia/core": "next",
"@theia/terminal": "next",
"xterm": "3.9.2",
"reconnecting-websocket": "^4.2.0",
"@eclipse-che/workspace-client": "latest",
"@eclipse-che/api": "latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import { TerminalQuickOpenService } from './contribution/terminal-quick-open';
import { RemoteTerminalWidgetOptions, REMOTE_TERMINAL_WIDGET_FACTORY_ID, REMOTE_TERMINAL_TARGET_SCOPE } from './terminal-widget/remote-terminal-widget';
import { RemoteWebSocketConnectionProvider } from './server-definition/remote-connection';
import { TerminalProxyCreator, TerminalProxyCreatorProvider, TerminalApiEndPointProvider } from './server-definition/terminal-proxy-creator';

import '../../src/browser/terminal-widget/terminal.css';
import 'xterm/lib/xterm.css';
import { cheWorkspaceServicePath, CHEWorkspaceService } from '../common/workspace-service';
import { ExecTerminalFrontendContribution, NewTerminalInSpecificContainer } from './contribution/exec-terminal-contribution';
import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { MessageService } from '@theia/core/lib/common';
import { OutputChannelManager, OutputChannel } from '@theia/output/lib/common/output-channel';
import URI from '@theia/core/lib/common/uri';
import ReconnectingWebSocket from 'reconnecting-websocket';
import { IDisposable } from 'xterm';
export const REMOTE_TERMINAL_TARGET_SCOPE = 'remote-terminal';
export const REMOTE_TERMINAL_WIDGET_FACTORY_ID = 'remote-terminal';
export const RemoteTerminalWidgetOptions = Symbol('RemoteTerminalWidgetOptions');
Expand Down Expand Up @@ -189,17 +190,18 @@ export class RemoteTerminalWidget extends TerminalWidgetImpl {

const sendListener = (data: string) => socket.send(data);

let onDataDisposeHandler: IDisposable;
socket.onopen = () => {
this.term.reset();
if (this.waitForRemoteConnection) {
this.waitForRemoteConnection.resolve(socket);
}

this.term.on('data', sendListener);
onDataDisposeHandler = this.term.onData(sendListener);
socket.onmessage = ev => this.write(ev.data);

this.toDispose.push(Disposable.create(() => {
this.term.off('data', sendListener);
onDataDisposeHandler.dispose();
socket.close();
}));

Expand All @@ -208,12 +210,16 @@ export class RemoteTerminalWidget extends TerminalWidgetImpl {
};

socket.onerror = err => {
this.term.off('data', sendListener);
if (onDataDisposeHandler) {
onDataDisposeHandler.dispose();
}
return Promise.resolve();
};

socket.onclose = code => {
this.term.off('data', sendListener);
if (onDataDisposeHandler) {
onDataDisposeHandler.dispose();
}
return Promise.resolve();
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,6 @@
{
"path": "../examples/electron/compile.tsconfig.json"
},
{
"path": "../examples/assembly/compile.tsconfig.json"
},
{
"path": "../examples/assembly/compile.tsconfig.json"
},
{
"path": "../examples/assembly/compile.tsconfig.json"
},
{
"path": "../examples/assembly/compile.tsconfig.json"
},
{
"path": "../examples/assembly/compile.tsconfig.json"
},
{
"path": "../examples/assembly/compile.tsconfig.json"
}
Expand Down
44 changes: 7 additions & 37 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4302,7 +4302,7 @@ [email protected], debug@=3.1.0:
dependencies:
ms "2.0.0"

debug@^3.0.0, debug@^3.1.0, debug@^3.2.6:
debug@^3.0.0, debug@^3.1.0:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
Expand Down Expand Up @@ -4524,7 +4524,7 @@ detect-indent@^5.0.0:
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d"
integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50=

detect-libc@^1.0.2, detect-libc@^1.0.3:
detect-libc@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
Expand Down Expand Up @@ -6320,7 +6320,7 @@ [email protected]:
dependencies:
safer-buffer ">= 2.1.2 < 3"

[email protected], iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
[email protected], iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@~0.4.13:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
Expand Down Expand Up @@ -9067,15 +9067,6 @@ ncp@~2.0.0:
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=

needle@^2.2.1:
version "2.3.2"
resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.2.tgz#3342dea100b7160960a450dc8c22160ac712a528"
integrity sha512-DUzITvPVDUy6vczKKYTnWc/pBZ0EnjMJnQ3y+Jo5zfKFimJs7S3HFCxCRZYB9FUZcrzUQr3WsmvZgddMEIZv6w==
dependencies:
debug "^3.2.6"
iconv-lite "^0.4.4"
sax "^1.2.4"

[email protected]:
version "0.6.2"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
Expand Down Expand Up @@ -9207,22 +9198,6 @@ node-notifier@^5.2.1, node-notifier@^5.4.2:
shellwords "^0.1.1"
which "^1.3.0"

node-pre-gyp@*:
version "0.14.0"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
dependencies:
detect-libc "^1.0.2"
mkdirp "^0.5.1"
needle "^2.2.1"
nopt "^4.0.1"
npm-packlist "^1.1.6"
npmlog "^4.0.2"
rc "^1.2.7"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^4.4.2"

noop-logger@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2"
Expand Down Expand Up @@ -9323,7 +9298,7 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1:
semver "^5.6.0"
validate-npm-package-name "^3.0.0"

npm-packlist@^1.1.6, npm-packlist@^1.4.4:
npm-packlist@^1.4.4:
version "1.4.8"
resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e"
integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==
Expand Down Expand Up @@ -9355,7 +9330,7 @@ npm-run-path@^2.0.0:
dependencies:
path-key "^2.0.0"

npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2:
npmlog@^4.0.1, npmlog@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
Expand Down Expand Up @@ -10329,7 +10304,7 @@ [email protected]:
iconv-lite "0.4.24"
unpipe "1.0.0"

rc@^1.1.6, rc@^1.2.7:
rc@^1.1.6:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
Expand Down Expand Up @@ -11661,7 +11636,7 @@ tar-stream@^1.1.2, tar-stream@^1.5.0, tar-stream@^1.5.2:
to-buffer "^1.1.1"
xtend "^4.0.0"

tar@^4.0.0, tar@^4.4.10, tar@^4.4.12, tar@^4.4.2, tar@^4.4.8:
tar@^4.0.0, tar@^4.4.10, tar@^4.4.12, tar@^4.4.8:
version "4.4.13"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
Expand Down Expand Up @@ -12823,11 +12798,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.13.0.tgz#d0e06c3cf4c1f079aa83f646948457db3b04220b"
integrity sha512-FZVmvkkbkky3zldJ2NNOZ9h8jirtbGTlF4sIKMDrejR4wPsVZ3o4F++DQVkdeZqjAwtNOMoR17PMSOTZ+h070g==

[email protected]:
version "3.9.2"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.9.2.tgz#e94bfbb84217b19bc1c16ed43d303b8245c9313d"
integrity sha512-fpQJQFTosY97EK4eB7UOrlFAwwqv1rSqlXgttEVD0S1v4MlevsUkRwrM/ew5X73jQXc+vdglRtccIhcXg5wtGg==

y18n@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
Expand Down