提交 52d14dae 编写于 作者: D Daniel Imms

Correct condition

上级 971196d8
......@@ -24,13 +24,14 @@ export interface ITerminalProcessFactory {
}
if (platform.isLinux) {
fileExists('/etc/os-release').then(exists => {
const file = '/etc/os-release';
fileExists(file).then(exists => {
if (!exists) {
return;
}
readFile('/etc/os-release').then(b => {
readFile(file).then(b => {
const contents = b.toString();
if (contents.indexOf('NAME=Fedora')) {
if (contents.indexOf('NAME=Fedora') >= 0) {
isFedora = true;
}
});
......
......@@ -11,7 +11,7 @@ import { Platform } from 'vs/base/common/platform';
import { TPromise } from 'vs/base/common/winjs.base';
import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper';
import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions';
import { isFedora } from 'vs/workbench/parts/terminal/electron-browser/terminal';
class MockConfigurationService implements IConfigurationService {
public _serviceBrand: any;
......@@ -63,7 +63,11 @@ suite('Workbench - TerminalConfigHelper', () => {
});
configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.getFont().fontFamily, 'foo', 'editor.fontFamily should be the fallback when terminal.integrated.fontFamily not set');
if (isFedora) {
assert.equal(configHelper.getFont().fontFamily, '\'DejaVu Sans Mono\'', 'Fedora should have its font overridden when terminal.integrated.fontFamily not set');
} else {
assert.equal(configHelper.getFont().fontFamily, 'foo', 'editor.fontFamily should be the fallback when terminal.integrated.fontFamily not set');
}
});
test('TerminalConfigHelper - getFont fontSize', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册