Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Terminal editors are always marked dirty.#134861

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Tyriar merged 1 commit intomicrosoft:mainfromluluyuzhi:main
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes fromall 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
28 changes: 13 additions & 15 deletionssrc/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -282,22 +282,20 @@ class SharedProcessMain extends Disposable {
services.set(IUserDataSyncResourceEnablementService, new SyncDescriptor(UserDataSyncResourceEnablementService));
services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService));

// Terminal
services.set(
ILocalPtyService,
this._register(
new PtyHostService({
graceTime: LocalReconnectConstants.GraceTime,
shortGraceTime: LocalReconnectConstants.ShortGraceTime,
scrollback: configurationService.getValue<number>(TerminalSettingId.PersistentSessionScrollback) ?? 100
},
configurationService,
environmentService,
logService,
telemetryService
)
)
const ptyHostService = new PtyHostService({
graceTime: LocalReconnectConstants.GraceTime,
shortGraceTime: LocalReconnectConstants.ShortGraceTime,
scrollback: configurationService.getValue<number>(TerminalSettingId.PersistentSessionScrollback) ?? 100
},
configurationService,
environmentService,
logService,
telemetryService
);
await ptyHostService.initialize();

// Terminal
services.set(ILocalPtyService, this._register(ptyHostService));

// Extension Host
services.set(IExtensionHostStarter, this._register(new ExtensionHostStarter(logService)));
Expand Down
3 changes: 3 additions & 0 deletionssrc/vs/platform/terminal/common/terminal.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -96,6 +96,7 @@ export const enum TerminalSettingId {
PersistentSessionScrollback = 'terminal.integrated.persistentSessionScrollback',
InheritEnv = 'terminal.integrated.inheritEnv',
ShowLinkHover = 'terminal.integrated.showLinkHover',
IgnoreProcessNames = 'terminal.integrated.ignoreProcessNames',
}

export enum WindowsShellType {
Expand DownExpand Up@@ -289,6 +290,8 @@ export interface IPtyService {
reviveTerminalProcesses(state: string): Promise<void>;
refreshProperty(id: number, property: ProcessPropertyType): Promise<any>;
updateProperty(id: number, property: ProcessPropertyType, value: any): Promise<void>;

setIgnoreProcessNames(names: string[]): Promise<void>;
}

export interface IRequestResolveVariablesEvent {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -371,6 +371,22 @@ const terminalPlatformConfiguration: IConfigurationNode = {
description: localize('terminal.integrated.showLinkHover', "Whether to show hovers for links in the terminal output."),
type: 'boolean',
default: true
},
[TerminalSettingId.IgnoreProcessNames]: {
description: localize('terminal.integrated.confirmIgnoreProcesses', "Configurable to provide a custom setting to ignore processes"),
type: 'array',
items: {
type: 'string',
uniqueItems: true
},
default: [
// Popular prompt programs, these should not count as child processes
'starship',
'oh-my-posh',
// Git bash may runs a subprocess of itself (bin\bash.exe -> usr\bin\bash.exe)
'bash',
'zsh',
]
}
}
};
Expand Down
8 changes: 1 addition & 7 deletionssrc/vs/platform/terminal/node/childProcessMonitor.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,13 +22,7 @@ const enum Constants {
ActiveDebounceDuration = 1000,
}

const ignoreProcessNames = [
// Popular prompt programs, these should not count as child processes
'starship',
'oh-my-posh',
// Git bash may runs a subprocess of itself (bin\bash.exe -> usr\bin\bash.exe)
'bash',
];
export const ignoreProcessNames: string[] = [];

/**
* Monitors a process for child processes, checking at differing times depending on input and output
Expand Down
20 changes: 19 additions & 1 deletionsrc/vs/platform/terminal/node/ptyHostService.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import { LogLevelChannelClient } from 'vs/platform/log/common/logIpc';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { RequestStore } from 'vs/platform/terminal/common/requestStore';
import { HeartbeatConstants, IHeartbeatService, IProcessDataEvent, IPtyService, IReconnectConstants, IRequestResolveVariablesEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, ITerminalProfile, ITerminalsLayoutInfo, TerminalIcon, TerminalIpcChannels, IProcessProperty, TerminalShellType, TitleEventSource, ProcessPropertyType, ProcessCapability, IProcessPropertyMap } from 'vs/platform/terminal/common/terminal';
import { HeartbeatConstants, IHeartbeatService, IProcessDataEvent, IPtyService, IReconnectConstants, IRequestResolveVariablesEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, ITerminalProfile, ITerminalsLayoutInfo, TerminalIcon, TerminalIpcChannels, IProcessProperty, TerminalShellType, TitleEventSource, ProcessPropertyType, ProcessCapability, IProcessPropertyMap, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
import { registerTerminalPlatformConfiguration } from 'vs/platform/terminal/common/terminalPlatformConfiguration';
import { IGetTerminalLayoutInfoArgs, IProcessDetails, IPtyHostProcessReplayEvent, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
import { detectAvailableProfiles } from 'vs/platform/terminal/node/terminalProfiles';
Expand DownExpand Up@@ -109,6 +109,24 @@ export class PtyHostService extends Disposable implements IPtyService {
this._resolveVariablesRequestStore.onCreateRequest(this._onPtyHostRequestResolveVariables.fire, this._onPtyHostRequestResolveVariables);

[this._client, this._proxy] = this._startPtyHost();

this._register(this._configurationService.onDidChangeConfiguration(async e => {
if (e.affectsConfiguration(TerminalSettingId.IgnoreProcessNames)) {
await this.setIgnoreProcessNames(this.ignoreProcessNames);
}
}));
}

async initialize(): Promise<void> {
await this.setIgnoreProcessNames(this.ignoreProcessNames);
}

private get ignoreProcessNames(): string[] {
return this._configurationService.getValue<string[]>(TerminalSettingId.IgnoreProcessNames);
}

setIgnoreProcessNames(names: string[]): Promise<void> {
return this._proxy.setIgnoreProcessNames(names);
}

private async _resolveShellEnv(): Promise<typeof process.env> {
Expand Down
9 changes: 9 additions & 0 deletionssrc/vs/platform/terminal/node/ptyService.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,6 +22,7 @@ import { IGetTerminalLayoutInfoArgs, IProcessDetails, IPtyHostProcessReplayEvent
import { getWindowsBuildNumber } from 'vs/platform/terminal/node/terminalEnvironment';
import { TerminalProcess } from 'vs/platform/terminal/node/terminalProcess';
import { localize } from 'vs/nls';
import { ignoreProcessNames } from 'vs/platform/terminal/node/childProcessMonitor';

type WorkspaceId = string;

Expand DownExpand Up@@ -81,6 +82,14 @@ export class PtyService extends Disposable implements IPtyService {
this._detachInstanceRequestStore = this._register(new RequestStore(undefined, this._logService));
this._detachInstanceRequestStore.onCreateRequest(this._onDidRequestDetach.fire, this._onDidRequestDetach);
}

setIgnoreProcessNames(names: string[]): Promise<void> {
return new Promise((_resolve, _reject) => {
ignoreProcessNames.length = 0;
ignoreProcessNames.push(...names);
});
}

onPtyHostExit?: Event<number> | undefined;
onPtyHostStart?: Event<void> | undefined;
onPtyHostUnresponsive?: Event<void> | undefined;
Expand Down
1 change: 1 addition & 0 deletionssrc/vs/workbench/contrib/terminal/common/terminal.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,6 +209,7 @@ export interface ITerminalConfiguration {
defaultLocation: TerminalLocationString;
customGlyphs: boolean;
persistentSessionReviveProcess: 'onExit' | 'onExitAndWindowClose' | 'never';
ignoreProcessNames: string[];
}

export const DEFAULT_LOCAL_ECHO_EXCLUDE: ReadonlyArray<string> = ['vim', 'vi', 'nano', 'tmux'];
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp