未验证 提交 01216213 编写于 作者: M Megan Rogge 提交者: GitHub

improve terminal title sanitizing, fix #115291 (#115634)

上级 a881dd44
......@@ -1507,10 +1507,17 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
}
switch (eventSource) {
case TitleEventSource.Process:
title = path.basename(title);
if (platform.isWindows) {
// Remove the .exe extension
title = path.basename(title);
title = title.split('.exe')[0];
} else {
const firstSpaceIndex = title.indexOf(' ');
if (title.startsWith('/')) {
title = path.basename(title);
} else if (firstSpaceIndex > -1) {
title = title.substring(0, firstSpaceIndex);
}
}
break;
case TitleEventSource.Api:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册