Skip to content

Commit

Permalink
Merge pull request #191805 from microsoft/merogge/set-default
Browse files Browse the repository at this point in the history
set default focusAfterRun to none
  • Loading branch information
meganrogge authored Aug 30, 2023
2 parents 5be6ae4 + 1e4020e commit fe0237c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,10 @@ const terminalConfiguration: IConfigurationNode = {
},
[TerminalSettingId.FocusAfterRun]: {
markdownDescription: localize('terminal.integrated.focusAfterRun', "Controls whether the terminal, accessible buffer, or neither will be focused after `Terminal: Run Selected Text In Active Terminal` has been run."),
enum: ['auto', 'terminal', 'accessible-buffer', 'none'],
default: 'auto',
enum: ['terminal', 'accessible-buffer', 'none'],
default: 'none',
tags: ['accessibility'],
markdownEnumDescriptions: [
localize('terminal.integrated.focusAfterRun.auto', "Set to `terminal` when in screen reader optimized mode and `none` otherwise."),
localize('terminal.integrated.focusAfterRun.terminal', "Always focus the terminal."),
localize('terminal.integrated.focusAfterRun.accessible-buffer', "Always focus the accessible buffer."),
localize('terminal.integrated.focusAfterRun.none', "Do nothing."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { localize } from 'vs/nls';
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
Expand Down Expand Up @@ -61,14 +61,12 @@ class AccessibleBufferContribution extends DisposableStore implements ITerminalC
processManager: ITerminalProcessManager,
widgetManager: TerminalWidgetManager,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService,
@IAccessibilityService accessibilityService: IAccessibilityService
@IConfigurationService configurationService: IConfigurationService
) {
super();
this.add(_instance.onDidRunText(() => {
const focusAfterRun = configurationService.getValue(TerminalSettingId.FocusAfterRun);
const focusTerminal = focusAfterRun === 'terminal' || (focusAfterRun === 'auto' && accessibilityService.isScreenReaderOptimized());
if (focusTerminal) {
if (focusAfterRun === 'terminal') {
_instance.focus(true);
} else if (focusAfterRun === 'accessible-buffer') {
this.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ShellIntegrationStatus, WindowsShellType } from 'vs/platform/terminal/common/terminal';
import { ShellIntegrationStatus, TerminalSettingId, WindowsShellType } from 'vs/platform/terminal/common/terminal';
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
import { AccessibleViewType, IAccessibleContentProvider, IAccessibleViewOptions } from 'vs/workbench/contrib/accessibility/browser/accessibleView';
import { ITerminalInstance, IXtermTerminal } from 'vs/workbench/contrib/terminal/browser/terminal';
Expand Down Expand Up @@ -93,6 +93,7 @@ export class TerminalAccessibleContentProvider extends Disposable implements IAc
}
content.push(this._descriptionForCommand(TerminalCommandId.OpenDetectedLink, localize('openDetectedLink', 'The Open Detected Link ({0}) command enables screen readers to easily open links found in the terminal.'), localize('openDetectedLinkNoKb', 'The Open Detected Link command enables screen readers to easily open links found in the terminal and is currently not triggerable by a keybinding.')));
content.push(this._descriptionForCommand(TerminalCommandId.NewWithProfile, localize('newWithProfile', 'The Create New Terminal (With Profile) ({0}) command allows for easy terminal creation using a specific profile.'), localize('newWithProfileNoKb', 'The Create New Terminal (With Profile) command allows for easy terminal creation using a specific profile and is currently not triggerable by a keybinding.')));
content.push(localize('focusAfterRun', 'Configure what gets focused after running selected text in the terminal with `{0}`.', TerminalSettingId.FocusAfterRun));
content.push(localize('accessibilitySettings', 'Access accessibility settings such as `terminal.integrated.tabFocusMode` via the Preferences: Open Accessibility Settings command.'));
return content.join('\n\n');
}
Expand Down

0 comments on commit fe0237c

Please sign in to comment.