From 2ba01cf7529cf8e49ddabaf2d3d5a906b12c6f32 Mon Sep 17 00:00:00 2001 From: mtsmfm Date: Sun, 22 Aug 2021 14:56:37 +0000 Subject: [PATCH] fix: Apply hack to allow to use ctrl-p on terminal --- .../browser/terminal-widget/remote-terminal-widget.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extensions/eclipse-che-theia-terminal/src/browser/terminal-widget/remote-terminal-widget.ts b/extensions/eclipse-che-theia-terminal/src/browser/terminal-widget/remote-terminal-widget.ts index 1d6b77b39..1f14b6f55 100644 --- a/extensions/eclipse-che-theia-terminal/src/browser/terminal-widget/remote-terminal-widget.ts +++ b/extensions/eclipse-che-theia-terminal/src/browser/terminal-widget/remote-terminal-widget.ts @@ -230,7 +230,16 @@ export class RemoteTerminalWidget extends TerminalWidgetImpl { this.socket = this.createWebSocket(this.terminalApiEndPoint!); - const sendListener = (data: string) => this.socket.send(data); + const sendListener = (data: string) => { + this.socket.send(data); + + // To use ctrl-p on terminal. + // On k8s with docker, ctrl-p ctrl-q is default detach keys and currently there's no way to customize. + // https://github.com/kubernetes/kubectl/issues/1011 + if (data === '\u0010') { + this.socket.send('\u0000'); + } + }; let onDataDisposeHandler: IDisposable; this.socket.onopen = () => {