提交 2399c269 编写于 作者: D Daniel Imms

Support windows links

上级 11298b84
......@@ -49,9 +49,26 @@ export class TerminalLinkHandler {
private _handleUnixLikeLocalLink(link: string): TPromise<void> {
// Resolve ~ -> $HOME
if (link.charAt(0) === '~') {
if (!process.env.HOME) {
return TPromise.as(void 0);
}
link = process.env.HOME + link.substring(1);
}
return this._handleCommonLocalLink(link);
}
private _handleWindowsLocalLink(link: string): TPromise<void> {
// Resolve ~ -> %HOMEDRIVE%\%HOMEPATH%
if (link.charAt(0) === '~') {
if (!process.env.HOMEDRIVE || !process.env.HOMEPATH) {
return TPromise.as(void 0);
}
link = `${process.env.HOMEDRIVE}\\${process.env.HOMEPATH + link.substring(1)}`;
}
return this._handleCommonLocalLink(link);
}
private _handleCommonLocalLink(link: string): TPromise<void> {
// Resolve workspace path . / .. -> <path>/. / <path/..
if (link.charAt(0) === '.') {
if (!this._contextService.hasWorkspace) {
......@@ -72,8 +89,4 @@ export class TerminalLinkHandler {
return this._editorService.openEditor({ resource }).then(() => void 0);
});
}
private _handleWindowsLocalLink(link: string): TPromise<void> {
return null;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册