mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
clean up (#274869)
This commit is contained in:
@@ -13,6 +13,7 @@ import { ITerminalOutputMatcher } from '../terminal.js';
|
||||
import { ICurrentPartialCommand, PartialTerminalCommand, TerminalCommand } from './commandDetection/terminalCommand.js';
|
||||
import { PromptInputModel, type IPromptInputModel } from './commandDetection/promptInputModel.js';
|
||||
import type { IBuffer, IDisposable, IMarker, Terminal } from '@xterm/headless';
|
||||
import { isString } from '../../../../base/common/types.js';
|
||||
|
||||
interface ITerminalDimensions {
|
||||
cols: number;
|
||||
@@ -371,8 +372,8 @@ export class CommandDetectionCapability extends Disposable implements ICommandDe
|
||||
this._nextCommandId = undefined; // Clear the pending ID
|
||||
} else if (
|
||||
this._nextCommandId &&
|
||||
typeof this.currentCommand.command === 'string' &&
|
||||
typeof this._nextCommandId.command === 'string' &&
|
||||
isString(this.currentCommand.command) &&
|
||||
isString(this._nextCommandId.command) &&
|
||||
this.currentCommand.command.trim() === this._nextCommandId.command.trim()
|
||||
) {
|
||||
this._currentCommand.id = this._nextCommandId.commandId;
|
||||
|
||||
@@ -97,7 +97,6 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
||||
private _dataFilter: SeamlessRelaunchDataFilter;
|
||||
private _processListeners?: IDisposable[];
|
||||
private _isDisconnected: boolean = false;
|
||||
private _hasLoggedSetNextCommandIdFallback = false;
|
||||
|
||||
private _processTraits: IProcessReadyEvent | undefined;
|
||||
private _shellLaunchConfig?: IShellLaunchConfig;
|
||||
@@ -599,27 +598,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
||||
if (!process) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await process.setNextCommandId(commandLine, commandId);
|
||||
} catch (error) {
|
||||
if (!this._shouldIgnoreSetNextCommandIdError(error)) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _shouldIgnoreSetNextCommandIdError(error: unknown): boolean {
|
||||
if (!(error instanceof Error) || !error.message) {
|
||||
return false;
|
||||
}
|
||||
if (!error.message.includes('Method not found: setNextCommandId') && !error.message.includes('Method not found: $setNextCommandId')) {
|
||||
return false;
|
||||
}
|
||||
if (!this._hasLoggedSetNextCommandIdFallback) {
|
||||
this._hasLoggedSetNextCommandIdFallback = true;
|
||||
this._logService.trace('setNextCommandId not supported by current terminal backend, falling back.');
|
||||
}
|
||||
return true;
|
||||
await process.setNextCommandId(commandLine, commandId);
|
||||
}
|
||||
|
||||
private _resize(cols: number, rows: number) {
|
||||
|
||||
Reference in New Issue
Block a user