-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Remove any from terminal in server #276272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -90,12 +90,12 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel< | |||||
|
|
||||||
| private _lastReqId = 0; | ||||||
| private readonly _pendingCommands = new Map<number, { | ||||||
| resolve: (data: any) => void; | ||||||
| reject: (err: any) => void; | ||||||
| resolve: (value: unknown) => void; | ||||||
| reject: (err?: unknown) => void; | ||||||
| uriTransformer: IURITransformer; | ||||||
| }>(); | ||||||
|
|
||||||
| private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; persistentProcessId: number; commandId: string; commandArgs: any[] }>()); | ||||||
| private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; persistentProcessId: number; commandId: string; commandArgs: unknown[] }>()); | ||||||
| readonly onExecuteCommand = this._onExecuteCommand.event; | ||||||
|
|
||||||
| constructor( | ||||||
|
|
@@ -109,6 +109,7 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel< | |||||
| super(); | ||||||
| } | ||||||
|
|
||||||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
| async call(ctx: RemoteAgentConnectionContext, command: RemoteTerminalChannelRequest, args?: any): Promise<any> { | ||||||
| switch (command) { | ||||||
| case RemoteTerminalChannelRequest.RestartPtyHost: return this._ptyHostService.restartPtyHost.apply(this._ptyHostService, args); | ||||||
|
|
@@ -167,21 +168,21 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel< | |||||
| throw new Error(`IPC Command ${command} not found`); | ||||||
| } | ||||||
|
|
||||||
| listen(_: any, event: RemoteTerminalChannelEvent, arg: any): Event<any> { | ||||||
| listen<T extends unknown>(_: unknown, event: RemoteTerminalChannelEvent, _arg: unknown): Event<T> { | ||||||
| switch (event) { | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostExitEvent: return this._ptyHostService.onPtyHostExit || Event.None; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostStartEvent: return this._ptyHostService.onPtyHostStart || Event.None; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostUnresponsiveEvent: return this._ptyHostService.onPtyHostUnresponsive || Event.None; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostResponsiveEvent: return this._ptyHostService.onPtyHostResponsive || Event.None; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostRequestResolveVariablesEvent: return this._ptyHostService.onPtyHostRequestResolveVariables || Event.None; | ||||||
| case RemoteTerminalChannelEvent.OnProcessDataEvent: return this._ptyHostService.onProcessData; | ||||||
| case RemoteTerminalChannelEvent.OnProcessReadyEvent: return this._ptyHostService.onProcessReady; | ||||||
| case RemoteTerminalChannelEvent.OnProcessExitEvent: return this._ptyHostService.onProcessExit; | ||||||
| case RemoteTerminalChannelEvent.OnProcessReplayEvent: return this._ptyHostService.onProcessReplay; | ||||||
| case RemoteTerminalChannelEvent.OnProcessOrphanQuestion: return this._ptyHostService.onProcessOrphanQuestion; | ||||||
| case RemoteTerminalChannelEvent.OnExecuteCommand: return this.onExecuteCommand; | ||||||
| case RemoteTerminalChannelEvent.OnDidRequestDetach: return this._ptyHostService.onDidRequestDetach || Event.None; | ||||||
| case RemoteTerminalChannelEvent.OnDidChangeProperty: return this._ptyHostService.onDidChangeProperty; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostExitEvent: return (this._ptyHostService.onPtyHostExit || Event.None) as Event<T>; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostStartEvent: return (this._ptyHostService.onPtyHostStart || Event.None) as Event<T>; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostUnresponsiveEvent: return (this._ptyHostService.onPtyHostUnresponsive || Event.None) as Event<T>; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostResponsiveEvent: return (this._ptyHostService.onPtyHostResponsive || Event.None) as Event<T>; | ||||||
| case RemoteTerminalChannelEvent.OnPtyHostRequestResolveVariablesEvent: return (this._ptyHostService.onPtyHostRequestResolveVariables || Event.None) as Event<T>; | ||||||
| case RemoteTerminalChannelEvent.OnProcessDataEvent: return (this._ptyHostService.onProcessData) as Event<T>; | ||||||
|
||||||
| case RemoteTerminalChannelEvent.OnProcessDataEvent: return (this._ptyHostService.onProcessData) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnProcessDataEvent: return this._ptyHostService.onProcessData as Event<T>; |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary parentheses in the type cast. Since there's no || Event.None fallback here, the parentheses can be removed: this._ptyHostService.onProcessReady as Event<T>
| case RemoteTerminalChannelEvent.OnProcessReadyEvent: return (this._ptyHostService.onProcessReady) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnProcessReadyEvent: return this._ptyHostService.onProcessReady as Event<T>; |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary parentheses in the type cast. Since there's no || Event.None fallback here, the parentheses can be removed: this._ptyHostService.onProcessExit as Event<T>
| case RemoteTerminalChannelEvent.OnProcessExitEvent: return (this._ptyHostService.onProcessExit) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnProcessExitEvent: return this._ptyHostService.onProcessExit as Event<T>; |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary parentheses in the type cast. Since there's no || Event.None fallback here, the parentheses can be removed: this._ptyHostService.onProcessReplay as Event<T>
| case RemoteTerminalChannelEvent.OnProcessReplayEvent: return (this._ptyHostService.onProcessReplay) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnProcessReplayEvent: return this._ptyHostService.onProcessReplay as Event<T>; |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary parentheses in the type cast. Since there's no || Event.None fallback here, the parentheses can be removed: this._ptyHostService.onProcessOrphanQuestion as Event<T>
| case RemoteTerminalChannelEvent.OnProcessOrphanQuestion: return (this._ptyHostService.onProcessOrphanQuestion) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnProcessOrphanQuestion: return this._ptyHostService.onProcessOrphanQuestion as Event<T>; |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary parentheses in the type cast. Since there's no || Event.None fallback here, the parentheses can be removed: this.onExecuteCommand as Event<T>
| case RemoteTerminalChannelEvent.OnExecuteCommand: return (this.onExecuteCommand) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnExecuteCommand: return this.onExecuteCommand as Event<T>; |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary parentheses in the type cast. Since there's no || Event.None fallback here, the parentheses can be removed: this._ptyHostService.onDidChangeProperty as Event<T>
| case RemoteTerminalChannelEvent.OnDidChangeProperty: return (this._ptyHostService.onDidChangeProperty) as Event<T>; | |
| case RemoteTerminalChannelEvent.OnDidChangeProperty: return this._ptyHostService.onDidChangeProperty as Event<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generic constraint
T extends unknownis redundant since all types extendunknownby definition. This can be simplified to just<T>.