提交 397d82d4 编写于 作者: D Daniel Imms

Support terminal bell

Fixes #32184
上级 114adf70
......@@ -3,7 +3,7 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data:; media-src 'none'; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https:;">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data:; media-src data:; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https:;">
</head>
<body class="monaco-shell vs-dark" aria-label="">
<script src="preload.js"></script>
......
......@@ -71,6 +71,7 @@ export interface ITerminalConfiguration {
commandsToSkipShell: string[];
cwd: string;
confirmOnExit: boolean;
enableBell: boolean;
env: {
linux: { [key: string]: string };
osx: { [key: string]: string };
......
......@@ -180,6 +180,11 @@ configurationRegistry.registerConfiguration({
'type': 'boolean',
'default': false
},
'terminal.integrated.enableBell': {
'description': nls.localize('terminal.integrated.enableBell', "Whether the terminal bell is enabled on not."),
'type': 'boolean',
'default': false
},
'terminal.integrated.commandsToSkipShell': {
'description': nls.localize('terminal.integrated.commandsToSkipShell', "A set of command IDs whose keybindings will not be sent to the shell and instead always be handled by Code. This allows the use of keybindings that would normally be consumed by the shell to act the same as when the terminal is not focused, for example ctrl+p to launch Quick Open."),
'type': 'array',
......
......@@ -267,7 +267,8 @@ export class TerminalInstance implements ITerminalInstance {
fontFamily: font.fontFamily,
fontSize: font.fontSize,
lineHeight: font.lineHeight,
enableBold: this._configHelper.config.enableBold
enableBold: this._configHelper.config.enableBold,
bellStyle: this._configHelper.config.enableBell ? 'sound' : 'none'
});
if (this._shellLaunchConfig.initialText) {
this._xterm.writeln(this._shellLaunchConfig.initialText);
......@@ -943,6 +944,7 @@ export class TerminalInstance implements ITerminalInstance {
this._setCursorStyle(this._configHelper.config.cursorStyle);
this._setCommandsToSkipShell(this._configHelper.config.commandsToSkipShell);
this._setScrollback(this._configHelper.config.scrollback);
this._setEnableBell(this._configHelper.config.enableBell);
}
private _setCursorBlink(blink: boolean): void {
......@@ -970,6 +972,20 @@ export class TerminalInstance implements ITerminalInstance {
}
}
private _setEnableBell(isEnabled: boolean): void {
if (this._xterm) {
if (this._xterm.getOption('bellStyle') === 'sound') {
if (!this._configHelper.config.enableBell) {
this._xterm.setOption('bellStyle', 'none');
}
} else {
if (this._configHelper.config.enableBell) {
this._xterm.setOption('bellStyle', 'sound');
}
}
}
}
public layout(dimension: Dimension): void {
const terminalWidth = this._evaluateColsAndRows(dimension.width, dimension.height);
if (!terminalWidth) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册