@@ -9,6 +9,7 @@ import { AutoOpenBarrier } from 'vs/base/common/async';
9
9
import { Event } from 'vs/base/common/event' ;
10
10
import { KeyCode } from 'vs/base/common/keyCodes' ;
11
11
import { DisposableStore , MutableDisposable , toDisposable } from 'vs/base/common/lifecycle' ;
12
+ import { isWindows } from 'vs/base/common/platform' ;
12
13
import { localize2 } from 'vs/nls' ;
13
14
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
14
15
import { ContextKeyExpr , IContextKey , IContextKeyService , IReadableSet } from 'vs/platform/contextkey/common/contextkey' ;
@@ -170,16 +171,20 @@ class TerminalSuggestContribution extends DisposableStore implements ITerminalCo
170
171
171
172
// If completions are requested, pause and queue input events until completions are
172
173
// received. This fixing some problems in PowerShell, particularly enter not executing
173
- // when typing quickly and some characters being printed twice.
174
- let barrier : AutoOpenBarrier | undefined ;
175
- this . add ( addon . onDidRequestCompletions ( ( ) => {
176
- barrier = new AutoOpenBarrier ( 2000 ) ;
177
- this . _instance . pauseInputEvents ( barrier ) ;
178
- } ) ) ;
179
- this . add ( addon . onDidReceiveCompletions ( ( ) => {
180
- barrier ?. open ( ) ;
181
- barrier = undefined ;
182
- } ) ) ;
174
+ // when typing quickly and some characters being printed twice. On Windows this isn't
175
+ // needed because inputs are _not_ echoed when not handled immediately.
176
+ // TODO: This should be based on the OS of the pty host, not the client
177
+ if ( ! isWindows ) {
178
+ let barrier : AutoOpenBarrier | undefined ;
179
+ this . add ( addon . onDidRequestCompletions ( ( ) => {
180
+ barrier = new AutoOpenBarrier ( 2000 ) ;
181
+ this . _instance . pauseInputEvents ( barrier ) ;
182
+ } ) ) ;
183
+ this . add ( addon . onDidReceiveCompletions ( ( ) => {
184
+ barrier ?. open ( ) ;
185
+ barrier = undefined ;
186
+ } ) ) ;
187
+ }
183
188
}
184
189
}
185
190
}
0 commit comments