mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
parent
9daf7d5fb9
commit
0941c02227
|
@ -404,7 +404,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
this._cwd = e;
|
||||
this._xtermOnKey?.dispose();
|
||||
this.refreshTabLabels(this.title, TitleEventSource.Config);
|
||||
this._instantiationService.invokeFunction(getDirectoryHistory)?.add(e, null);
|
||||
this._instantiationService.invokeFunction(getDirectoryHistory)?.add(e, { remoteAuthority: this.remoteAuthority });
|
||||
});
|
||||
} else if (e === TerminalCapability.CommandDetection) {
|
||||
this.capabilities.get(TerminalCapability.CommandDetection)?.onCommandFinished(e => {
|
||||
|
@ -855,9 +855,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
// Gather previous session history
|
||||
const history = this._instantiationService.invokeFunction(getDirectoryHistory);
|
||||
const previousSessionItems: IQuickPickItem[] = [];
|
||||
// Only add previous session item if it's not in this session
|
||||
for (const [label] of history.entries) {
|
||||
if (!cwds.includes(label)) {
|
||||
// Only add previous session item if it's not in this session and it matches the remote authority
|
||||
for (const [label, info] of history.entries) {
|
||||
if ((info === null || info.remoteAuthority === this.remoteAuthority) && !cwds.includes(label)) {
|
||||
previousSessionItems.push({
|
||||
label,
|
||||
buttons: [removeFromCommandHistoryButton]
|
||||
|
|
|
@ -53,10 +53,10 @@ export function getCommandHistory(accessor: ServicesAccessor): ITerminalPersiste
|
|||
return commandHistory;
|
||||
}
|
||||
|
||||
let directoryHistory: ITerminalPersistedHistory<null> | undefined = undefined;
|
||||
export function getDirectoryHistory(accessor: ServicesAccessor): ITerminalPersistedHistory<null> {
|
||||
let directoryHistory: ITerminalPersistedHistory<{ remoteAuthority?: string }> | undefined = undefined;
|
||||
export function getDirectoryHistory(accessor: ServicesAccessor): ITerminalPersistedHistory<{ remoteAuthority?: string }> {
|
||||
if (!directoryHistory) {
|
||||
directoryHistory = accessor.get(IInstantiationService).createInstance(TerminalPersistedHistory, 'dirs') as TerminalPersistedHistory<null>;
|
||||
directoryHistory = accessor.get(IInstantiationService).createInstance(TerminalPersistedHistory, 'dirs') as TerminalPersistedHistory<{ remoteAuthority?: string }>;
|
||||
}
|
||||
return directoryHistory;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue