Skip to content

Commit 49fab0a

Browse files
committed
Add kitty keyboard setting
Fixes #286809
1 parent 41eb203 commit 49fab0a

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/vs/platform/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export const enum TerminalSettingId {
120120
FontLigaturesEnabled = 'terminal.integrated.fontLigatures.enabled',
121121
FontLigaturesFeatureSettings = 'terminal.integrated.fontLigatures.featureSettings',
122122
FontLigaturesFallbackLigatures = 'terminal.integrated.fontLigatures.fallbackLigatures',
123+
EnableKittyKeyboardProtocol = 'terminal.integrated.enableKittyKeyboardProtocol',
123124

124125
// Developer/debug settings
125126

src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
243243
},
244244
ignoreBracketedPasteMode: config.ignoreBracketedPasteMode,
245245
rescaleOverlappingGlyphs: config.rescaleOverlappingGlyphs,
246+
vtExtensions: {
247+
kittyKeyboard: config.enableKittyKeyboardProtocol
248+
},
246249
windowOptions: {
247250
getWinSizePixels: true,
248251
getCellSizePixels: true,
@@ -537,6 +540,7 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
537540
this.raw.options.wordSeparator = config.wordSeparators;
538541
this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode;
539542
this.raw.options.rescaleOverlappingGlyphs = config.rescaleOverlappingGlyphs;
543+
this.raw.options.vtExtensions = { kittyKeyboard: config.enableKittyKeyboardProtocol };
540544

541545
this._updateSmoothScrolling();
542546
if (this._attached) {

src/vs/workbench/contrib/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export interface ITerminalConfiguration {
208208
smoothScrolling: boolean;
209209
ignoreBracketedPasteMode: boolean;
210210
rescaleOverlappingGlyphs: boolean;
211+
enableKittyKeyboardProtocol: boolean;
211212
fontLigatures?: {
212213
enabled: boolean;
213214
featureSettings: string;

src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ const terminalConfiguration: IStringDictionary<IConfigurationPropertySchema> = {
562562
localize('hideOnStartup.whenEmpty', "Only hide the terminal when there are no persistent sessions restored."),
563563
localize('hideOnStartup.always', "Always hide the terminal, even when there are persistent sessions restored.")
564564
],
565-
default: 'never'
565+
default: 'never',
566566
},
567567
[TerminalSettingId.HideOnLastClosed]: {
568568
description: localize('terminal.integrated.hideOnLastClosed', "Whether to hide the terminal view when the last terminal is closed. This will only happen when the terminal is the only visible view in the view container."),
@@ -587,6 +587,16 @@ const terminalConfiguration: IStringDictionary<IConfigurationPropertySchema> = {
587587
type: 'boolean',
588588
default: true
589589
},
590+
[TerminalSettingId.EnableKittyKeyboardProtocol]: {
591+
restricted: true,
592+
markdownDescription: localize('terminal.integrated.enableKittyKeyboardProtocol', "Whether to enable the kitty keyboard protocol, which provides more detailed keyboard input reporting to the terminal."),
593+
type: 'boolean',
594+
default: false,
595+
tags: ['experimental'],
596+
experiment: {
597+
mode: 'auto'
598+
}
599+
},
590600
[TerminalSettingId.ShellIntegrationEnabled]: {
591601
restricted: true,
592602
markdownDescription: localize('terminal.integrated.shellIntegration.enabled', "Determines whether or not shell integration is auto-injected to support features like enhanced command tracking and current working directory detection. \n\nShell integration works by injecting the shell with a startup script. The script gives VS Code insight into what is happening within the terminal.\n\nSupported shells:\n\n- Linux/macOS: bash, fish, pwsh, zsh\n - Windows: pwsh, git bash\n\nThis setting applies only when terminals are created, so you will need to restart your terminals for it to take effect.\n\n Note that the script injection may not work if you have custom arguments defined in the terminal profile, have enabled {1}, have a [complex bash `PROMPT_COMMAND`](https://code.visualstudio.com/docs/editor/integrated-terminal#_complex-bash-promptcommand), or other unsupported setup. To disable decorations, see {0}", '`#terminal.integrated.shellIntegration.decorationsEnabled#`', '`#editor.accessibilitySupport#`'),

0 commit comments

Comments
 (0)