Skip to content
Merged
Changes from all 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
19 changes: 12 additions & 7 deletions packages/terminal-next/src/browser/links/link-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export class TerminalLinkManager extends Disposable {

private _getHomeDirPromise: Promise<string>;

private _wrappedTextLinkActivateCallback: XtermLinkMatcherHandler;

constructor(private _xterm: Terminal, private _client: TerminalClient) {
super();

Expand All @@ -127,6 +129,7 @@ export class TerminalLinkManager extends Disposable {

// Validated local links
const wrappedTextLinkActivateCallback = this._wrapLinkHandler((_, link) => this._handleLocalLink(link));
this._wrappedTextLinkActivateCallback = wrappedTextLinkActivateCallback;
const validatedProvider = this.injector.get(TerminalValidatedLocalLinkProvider, [
this._xterm,
this._client,
Expand All @@ -136,19 +139,21 @@ export class TerminalLinkManager extends Disposable {
async (link, cb) => cb(await this._resolvePath(link)),
]);
this._standardLinkProviders.push(validatedProvider);
this.addTerminalWordLinkProvider();
this._registerStandardLinkProviders();
}

public set processCwd(processCwd: string) {
this._processCwd = processCwd;
}

public addTerminalWordLinkProvider() {
const wordLinkProvider = this.injector.get(TerminalWordLinkProvider, [
this._xterm,
async (link, cb) => cb(await this._resolvePath(link)),
wrappedTextLinkActivateCallback,
this._wrappedTextLinkActivateCallback,
]);
this._standardLinkProviders.push(wordLinkProvider);

this._registerStandardLinkProviders();
}

public set processCwd(processCwd: string) {
this._processCwd = processCwd;
}

// user may change the terminal cwd, so we need to get it from the service
Expand Down
Loading