@@ -7,6 +7,7 @@ import * as dom from 'vs/base/browser/dom';
7
7
import { status } from 'vs/base/browser/ui/aria/aria' ;
8
8
import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel' ;
9
9
import { Event } from 'vs/base/common/event' ;
10
+ import { ResolvedKeybinding } from 'vs/base/common/keybindings' ;
10
11
import { Disposable } from 'vs/base/common/lifecycle' ;
11
12
import { OS } from 'vs/base/common/platform' ;
12
13
import { ContentWidgetPositionPreference , ICodeEditor , IContentWidget , IContentWidgetPosition } from 'vs/editor/browser/editorBrowser' ;
@@ -121,25 +122,29 @@ export class ReplInputHintContentWidget extends Disposable implements IContentWi
121
122
private getKeybinding ( ) {
122
123
const keybindings = this . keybindingService . lookupKeybindings ( 'interactive.execute' ) ;
123
124
const shiftEnterConfig = this . configurationService . getValue ( InteractiveWindowSetting . executeWithShiftEnter ) ;
125
+ const hasChord = ( chord : string , kb : ResolvedKeybinding ) => {
126
+ const chords = kb . getDispatchChords ( ) ;
127
+ return chords . length === 1 && chords [ 0 ] === chord ;
128
+ } ;
124
129
125
130
if ( shiftEnterConfig ) {
126
- const keybinding = keybindings . find ( kb => kb . getLabel ( ) === 'Shift +Enter') ;
131
+ const keybinding = keybindings . find ( kb => hasChord ( 'shift +Enter', kb ) ) ;
127
132
if ( keybinding ) {
128
133
return keybinding ;
129
134
}
130
135
} else {
131
- let keybinding = keybindings . find ( kb => kb . getLabel ( ) === 'Enter' ) ;
136
+ let keybinding = keybindings . find ( kb => hasChord ( 'Enter' , kb ) ) ;
132
137
if ( keybinding ) {
133
138
return keybinding ;
134
139
}
135
140
keybinding = this . keybindingService . lookupKeybindings ( 'python.execInREPLEnter' )
136
- . find ( kb => kb . getLabel ( ) === 'Enter' ) ;
141
+ . find ( kb => hasChord ( 'Enter' , kb ) ) ;
137
142
if ( keybinding ) {
138
143
return keybinding ;
139
144
}
140
145
}
141
146
142
- return undefined ;
147
+ return keybindings ?. [ 0 ] ;
143
148
}
144
149
145
150
override dispose ( ) : void {
0 commit comments