MCPcopy Create free account
hub / github.com/Marus/cortex-debug / handleInput

Method handleInput

src/frontend/pty.ts:154–181  ·  view source on GitHub ↗
(chars: string)

Source from the content-addressed store, hash-verified

152 }
153
154 protected handleInput(chars: string): void {
155 if (this.isPaused || (this.options.inputMode === TerminalInputMode.DISABLED)) {
156 return;
157 }
158 try {
159 switch (chars) {
160 case KEYS.enter:
161 this.handleReturn(chars);
162 break;
163 case KEYS.del:
164 if (this.options.inputMode === TerminalInputMode.COOKED) {
165 this.killPrevChar();
166 } else {
167 this.emit('data', chars);
168 }
169 break;
170 default:
171 if (!this.handleSpecialChars(chars)) {
172 // Handle special chars and leave the rest.
173 this.handleOtherChars(chars);
174 }
175 break;
176 }
177 }
178 catch (e) {
179 console.error(`MyPtyTerminal: handleInput: ${e}`);
180 }
181 }
182
183 private handleReturn(chr: string) {
184 if (this.options.inputMode === TerminalInputMode.COOKED) {

Callers 1

PtyTerminalClass · 0.95

Calls 4

handleReturnMethod · 0.95
killPrevCharMethod · 0.95
handleSpecialCharsMethod · 0.95
handleOtherCharsMethod · 0.95

Tested by

no test coverage detected